From 45415e8c070cfe424d4aaa01c3c19cac4dea3345 Mon Sep 17 00:00:00 2001 From: Unknown Date: Tue, 6 Sep 2011 08:57:15 -0700 Subject: Added driver script and GPUVerify libary. The driver script works around the fact that Boogie does not do deep cloning of expressions when turning a structured program into an unstructured one. --- Source/GPUVerify/CommandLineOptions.cs | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) (limited to 'Source/GPUVerify/CommandLineOptions.cs') diff --git a/Source/GPUVerify/CommandLineOptions.cs b/Source/GPUVerify/CommandLineOptions.cs index 80dc18ef..812d9f20 100644 --- a/Source/GPUVerify/CommandLineOptions.cs +++ b/Source/GPUVerify/CommandLineOptions.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.IO; +using System.Diagnostics; namespace GPUVerify { @@ -12,11 +13,41 @@ namespace GPUVerify public static List inputFiles = new List(); + public static string outputFile = null; + public static int Parse(string[] args) { for (int i = 0; i < args.Length; i++) { - inputFiles.Add(args[i]); + bool hasColonArgument = false; + string beforeColon; + string afterColon = null; + int colonIndex = args[i].IndexOf(':'); + if (colonIndex >= 0 && (args[i].StartsWith("-") || args[i].StartsWith("/"))) { + hasColonArgument = true; + beforeColon = args[i].Substring(0, colonIndex); + afterColon = args[i].Substring(colonIndex + 1); + } else { + beforeColon = args[i]; + } + + switch (beforeColon) + { + case "-print": + case "/print": + if (!hasColonArgument) + { + Console.WriteLine("Error: filename expected after " + beforeColon + " argument"); + Environment.Exit(1); + } + Debug.Assert(afterColon != null); + outputFile = afterColon; + break; + + default: + inputFiles.Add(args[i]); + break; + } } return 0; } -- cgit v1.2.3