diff options
author | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2015-01-19 09:21:44 +0000 |
---|---|---|
committer | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2015-01-19 09:21:44 +0000 |
commit | 51ffe316a0db5e2a4bb97b604ab91d9b5fc432bb (patch) | |
tree | 382e48c0e1caa38d0215f6d081d34ce8bfe5c0af /test | |
parent | d32afaf6e05170ca2f7fd9a34f480cfde6b4fd04 (diff) |
[sanitizer] Move options-related tests to sanitizer_common.
And handle help=1 in standalone LSan.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@226438 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/asan/TestCases/asan_options-include.cc | 21 | ||||
-rw-r--r-- | test/asan/TestCases/asan_options-invalid.cc | 7 | ||||
-rw-r--r-- | test/sanitizer_common/TestCases/options-help.cc | 8 | ||||
-rw-r--r-- | test/sanitizer_common/TestCases/options-include.cc | 21 | ||||
-rw-r--r-- | test/sanitizer_common/TestCases/options-invalid.cc | 7 |
5 files changed, 36 insertions, 28 deletions
diff --git a/test/asan/TestCases/asan_options-include.cc b/test/asan/TestCases/asan_options-include.cc deleted file mode 100644 index 86c2e7ca2..000000000 --- a/test/asan/TestCases/asan_options-include.cc +++ /dev/null @@ -1,21 +0,0 @@ -// RUN: %clangxx_asan -O0 %s -o %t -// RUN: echo -e "symbolize=1\ninclude='%t.options2.txt'" >%t.options1.txt -// RUN: echo -e "verbosity=1\n" >%t.options2.txt -// RUN: cat %t.options1.txt -// RUN: cat %t.options2.txt -// RUN: ASAN_OPTIONS="verbosity=0:include='%t.options1.txt'" %run %t 2>&1 | tee %t.out -// RUN: FileCheck %s --check-prefix=CHECK-VERBOSITY1 <%t.out -// RUN: ASAN_OPTIONS="include='%t.options1.txt',verbosity=0" %run %t 2>&1 | tee %t.out -// RUN: FileCheck %s --check-prefix=CHECK-VERBOSITY0 <%t.out -// RUN: ASAN_OPTIONS="include='%t.options-not-found.txt',verbosity=0" not %run %t 2>&1 | tee %t.out -// RUN: FileCheck %s --check-prefix=CHECK-NOT-FOUND < %t.out - -#include <stdio.h> - -int main() { - fprintf(stderr, "done\n"); -} - -// CHECK-VERBOSITY1: Parsed ASAN_OPTIONS: -// CHECK-VERBOSITY0-NOT: Parsed ASAN_OPTIONS: -// CHECK-NOT-FOUND: Failed to read options from diff --git a/test/asan/TestCases/asan_options-invalid.cc b/test/asan/TestCases/asan_options-invalid.cc deleted file mode 100644 index ced2481ca..000000000 --- a/test/asan/TestCases/asan_options-invalid.cc +++ /dev/null @@ -1,7 +0,0 @@ -// RUN: %clangxx_asan -O0 %s -o %t -// RUN: ASAN_OPTIONS=invalid_option_name=10 not %run %t 2>&1 | FileCheck %s - -int main() { -} - -// CHECK: Unknown flag{{.*}}invalid_option_name diff --git a/test/sanitizer_common/TestCases/options-help.cc b/test/sanitizer_common/TestCases/options-help.cc new file mode 100644 index 000000000..eaa04a494 --- /dev/null +++ b/test/sanitizer_common/TestCases/options-help.cc @@ -0,0 +1,8 @@ +// RUN: %clangxx -O0 %s -o %t +// RUN: %tool_options=help=1 %run %t 2>&1 | FileCheck %s + +int main() { +} + +// CHECK: Available flags for {{.*}}Sanitizer: +// CHECK: handle_segv diff --git a/test/sanitizer_common/TestCases/options-include.cc b/test/sanitizer_common/TestCases/options-include.cc new file mode 100644 index 000000000..ae8995164 --- /dev/null +++ b/test/sanitizer_common/TestCases/options-include.cc @@ -0,0 +1,21 @@ +// RUN: %clangxx -O0 %s -o %t +// RUN: echo -e "symbolize=1\ninclude='%t.options2.txt'" >%t.options1.txt +// RUN: echo -e "help=1\n" >%t.options2.txt +// RUN: cat %t.options1.txt +// RUN: cat %t.options2.txt +// RUN: %tool_options="help=0:include='%t.options1.txt'" %run %t 2>&1 | tee %t.out +// RUN: FileCheck %s --check-prefix=CHECK-VERBOSITY1 <%t.out +// RUN: %tool_options="include='%t.options1.txt',help=0" %run %t 2>&1 | tee %t.out +// RUN: FileCheck %s --check-prefix=CHECK-VERBOSITY0 <%t.out +// RUN: %tool_options="include='%t.options-not-found.txt',help=1" not %run %t 2>&1 | tee %t.out +// RUN: FileCheck %s --check-prefix=CHECK-NOT-FOUND < %t.out + +#include <stdio.h> + +int main() { + fprintf(stderr, "done\n"); +} + +// CHECK-VERBOSITY1: Available flags for +// CHECK-VERBOSITY0-NOT: Available flags for +// CHECK-NOT-FOUND: Failed to read options from diff --git a/test/sanitizer_common/TestCases/options-invalid.cc b/test/sanitizer_common/TestCases/options-invalid.cc new file mode 100644 index 000000000..940f1bbbf --- /dev/null +++ b/test/sanitizer_common/TestCases/options-invalid.cc @@ -0,0 +1,7 @@ +// RUN: %clangxx -O0 %s -o %t +// RUN: %tool_options=invalid_option_name=10 not %run %t 2>&1 | FileCheck %s + +int main() { +} + +// CHECK: Unknown flag{{.*}}invalid_option_name |