summaryrefslogtreecommitdiff
path: root/Source/GPUVerify/CommandLineOptions.cs
diff options
context:
space:
mode:
authorGravatar Unknown <t-alasdo@MSR-RISE-GUEST.redmond.corp.microsoft.com>2011-09-06 08:57:15 -0700
committerGravatar Unknown <t-alasdo@MSR-RISE-GUEST.redmond.corp.microsoft.com>2011-09-06 08:57:15 -0700
commit45415e8c070cfe424d4aaa01c3c19cac4dea3345 (patch)
treeb803c8e7884cd89e44113e013f2458bdf13215eb /Source/GPUVerify/CommandLineOptions.cs
parent68abcafd6a654bb319738415a4d94dfa6baa3bfd (diff)
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.
Diffstat (limited to 'Source/GPUVerify/CommandLineOptions.cs')
-rw-r--r--Source/GPUVerify/CommandLineOptions.cs33
1 files changed, 32 insertions, 1 deletions
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<string> inputFiles = new List<string>();
+ 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;
}