summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorAlexey Samsonov <vonosmas@gmail.com>2014-12-19 18:41:43 +0000
committerAlexey Samsonov <vonosmas@gmail.com>2014-12-19 18:41:43 +0000
commitabd5bead3fc1636ae6fcb5cb689d5701e77d86a9 (patch)
treedcf9e2bd99b6f9256495289114ef32fa9506cb57 /clang/test
parent9b7cee666bd597defea1eed6b202264e9a93a7ae (diff)
downloadbcm5719-llvm-abd5bead3fc1636ae6fcb5cb689d5701e77d86a9.tar.gz
bcm5719-llvm-abd5bead3fc1636ae6fcb5cb689d5701e77d86a9.zip
Allow to disable all sanitizers with "-fno-sanitize=all" option.
Summary: This patch adds "all" sanitizer group. A shortcut "-fno-sanitize=all" can be used to disable all sanitizers for a given source file. "-fsanitize=all" option makes no sense, and will produce an error. This group can also be useful when we add "-fsanitize-recover=<list>" options (patch in http://reviews.llvm.org/D6302), as it would allow to conveniently enable/disable recovery for all specified sanitizers. Test Plan: regression test suite Reviewers: kcc, rsmith Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D6733 llvm-svn: 224596
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Driver/fsanitize.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/test/Driver/fsanitize.c b/clang/test/Driver/fsanitize.c
index 2d15b4d1f42..dbe3c61f50e 100644
--- a/clang/test/Driver/fsanitize.c
+++ b/clang/test/Driver/fsanitize.c
@@ -15,6 +15,12 @@
// RUN: %clang -fsanitize=bounds -### -fsyntax-only %s 2>&1 | FileCheck %s --check-prefix=CHECK-BOUNDS
// CHECK-BOUNDS: "-fsanitize={{((array-bounds|local-bounds),?){2}"}}
+// RUN: %clang -target x86_64-linux-gnu -fsanitize=all %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-FSANITIZE-ALL
+// CHECK-FSANITIZE-ALL: error: unsupported argument 'all' to option 'fsanitize='
+
+// RUN: %clang -target x86_64-linux-gnu -fsanitize=address,undefined -fno-sanitize=all -fsanitize=thread %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-FNO-SANITIZE-ALL
+// CHECK-FNO-SANITIZE-ALL: "-fsanitize=thread"
+
// RUN: %clang -target x86_64-linux-gnu -fsanitize=thread,undefined -fno-sanitize=thread -fno-sanitize=float-cast-overflow,vptr,bool,enum %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PARTIAL-UNDEFINED
// CHECK-PARTIAL-UNDEFINED: "-fsanitize={{((signed-integer-overflow|integer-divide-by-zero|float-divide-by-zero|function|shift|unreachable|return|vla-bound|alignment|null|object-size|array-bounds|returns-nonnull-attribute|nonnull-attribute),?){14}"}}
OpenPOWER on IntegriCloud