summaryrefslogtreecommitdiffstats
path: root/clang/test/Driver/cloudabi.c
diff options
context:
space:
mode:
authorEd Schouten <ed@nuxi.nl>2016-03-29 21:13:53 +0000
committerEd Schouten <ed@nuxi.nl>2016-03-29 21:13:53 +0000
commitfc79d2ca42be5e803091aaea8a90d3c347a5a5ce (patch)
treecfa503a38d93d40d468b6a3d60a41ec20874d669 /clang/test/Driver/cloudabi.c
parent4cfe93c599df862cb9c8f982374892ea05d65260 (diff)
downloadbcm5719-llvm-fc79d2ca42be5e803091aaea8a90d3c347a5a5ce.tar.gz
bcm5719-llvm-fc79d2ca42be5e803091aaea8a90d3c347a5a5ce.zip
Enable the SafeStack sanitizer on CloudABI by default.
Over the last month we've been testing SafeStack extensively. As far as we know, it works perfectly fine. That why I'd like to see us having this enabled by default for CloudABI. This change introduces a getDefaultSanitizers() function that toolchains can use to specify which sanitizers are enabled by default. Once all flags are processed, only flags that had no -fno-sanitize overrides are enabled. Extend the thests for CloudABI to test both the default case and the case in which we want to explicitly disable SafeStack. Reviewed by: eugenis, pcc Differential Revision: http://reviews.llvm.org/D18505 llvm-svn: 264787
Diffstat (limited to 'clang/test/Driver/cloudabi.c')
-rw-r--r--clang/test/Driver/cloudabi.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/clang/test/Driver/cloudabi.c b/clang/test/Driver/cloudabi.c
index 99a2bc24f65..2f1f9852b0a 100644
--- a/clang/test/Driver/cloudabi.c
+++ b/clang/test/Driver/cloudabi.c
@@ -1,3 +1,8 @@
-// RUN: %clang %s -### -target x86_64-unknown-cloudabi 2>&1 | FileCheck %s
-// CHECK: "-cc1" "-triple" "x86_64-unknown-cloudabi" {{.*}} "-ffunction-sections" "-fdata-sections"
-// CHECK: "-Bstatic" "--eh-frame-hdr" "--gc-sections" "-o" "a.out" "crt0.o" "crtbegin.o" "{{.*}}" "{{.*}}" "-lc" "-lcompiler_rt" "crtend.o"
+// RUN: %clang %s -### -target x86_64-unknown-cloudabi 2>&1 | FileCheck %s -check-prefix=SAFESTACK
+// SAFESTACK: "-cc1" "-triple" "x86_64-unknown-cloudabi" {{.*}} "-ffunction-sections" "-fdata-sections" {{.*}} "-fsanitize=safe-stack"
+// SAFESTACK: "-Bstatic" "--eh-frame-hdr" "--gc-sections" "-o" "a.out" "crt0.o" "crtbegin.o" "{{.*}}" "{{.*}}" "-lc" "-lcompiler_rt" "crtend.o"
+
+// RUN: %clang %s -### -target x86_64-unknown-cloudabi -fno-sanitize=safe-stack 2>&1 | FileCheck %s -check-prefix=NOSAFESTACK
+// NOSAFESTACK: "-cc1" "-triple" "x86_64-unknown-cloudabi" {{.*}} "-ffunction-sections" "-fdata-sections"
+// NOSAFESTACK-NOT: "-fsanitize=safe-stack"
+// NOSAFESTACK: "-Bstatic" "--eh-frame-hdr" "--gc-sections" "-o" "a.out" "crt0.o" "crtbegin.o" "{{.*}}" "{{.*}}" "-lc" "-lcompiler_rt" "crtend.o"
OpenPOWER on IntegriCloud