diff options
-rw-r--r-- | Source/Core/CommandLineOptions.cs | 2 | ||||
-rw-r--r-- | Test/commandline/multiple_procs_verify_one.bpl | 22 | ||||
-rw-r--r-- | Test/commandline/multiple_procs_verify_one_request_twice.bpl | 20 | ||||
-rw-r--r-- | Test/commandline/multiple_procs_verify_two.bpl | 17 |
4 files changed, 60 insertions, 1 deletions
diff --git a/Source/Core/CommandLineOptions.cs b/Source/Core/CommandLineOptions.cs index 1c7f40d4..2be1cdf7 100644 --- a/Source/Core/CommandLineOptions.cs +++ b/Source/Core/CommandLineOptions.cs @@ -1700,7 +1700,7 @@ namespace Microsoft.Boogie { // no preference return true; } - return ProcsToCheck.Any(s => 0 <= methodFullname.IndexOf(s)); + return ProcsToCheck.Contains(methodFullname); } public virtual StringCollection ParseNamedArgumentList(string argList) { diff --git a/Test/commandline/multiple_procs_verify_one.bpl b/Test/commandline/multiple_procs_verify_one.bpl new file mode 100644 index 00000000..eaaa9af4 --- /dev/null +++ b/Test/commandline/multiple_procs_verify_one.bpl @@ -0,0 +1,22 @@ +// RUN: %boogie -proc:foo "%s" > "%t" +// RUN: %OutputCheck --file-to-check %t %s +// CHECK-L: Boogie program verifier finished with 1 verified, 0 errors + +// Only this procedure should be verified, the others should be ignored +procedure foo() +{ + assume true; +} + +// An old version of Boogie just checked if the name passed to ``-proc:`` +// occurs somewhere in procedure name which would cause it to try and also +// verify the procedures below. +procedure foo2() +{ + assert false; +} + +procedure function_foo() +{ + assert false; +} diff --git a/Test/commandline/multiple_procs_verify_one_request_twice.bpl b/Test/commandline/multiple_procs_verify_one_request_twice.bpl new file mode 100644 index 00000000..fe9c44ba --- /dev/null +++ b/Test/commandline/multiple_procs_verify_one_request_twice.bpl @@ -0,0 +1,20 @@ +// RUN: %boogie -proc:foo -proc:foo "%s" > "%t" +// RUN: %OutputCheck --file-to-check %t %s +// CHECK-L: Boogie program verifier finished with 1 verified, 0 errors + +// Although the command line requests two verify this procedure twice we should +// only do try once. +procedure foo() +{ + assume true; +} + +procedure bar() +{ + assert false; +} + +procedure baz() +{ + assert false; +} diff --git a/Test/commandline/multiple_procs_verify_two.bpl b/Test/commandline/multiple_procs_verify_two.bpl new file mode 100644 index 00000000..9e3fb0c6 --- /dev/null +++ b/Test/commandline/multiple_procs_verify_two.bpl @@ -0,0 +1,17 @@ +// RUN: %boogie -proc:foo -proc:bar "%s" > "%t" +// RUN: %OutputCheck --file-to-check %t %s +// CHECK-L: Boogie program verifier finished with 2 verified, 0 errors +procedure foo() +{ + assume true; +} + +procedure bar() +{ + assert true; +} + +procedure barz() +{ + assert false; +} |