summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorBruno Cardoso Lopes <bruno.cardoso@gmail.com>2016-12-08 00:22:06 +0000
committerBruno Cardoso Lopes <bruno.cardoso@gmail.com>2016-12-08 00:22:06 +0000
commitcfd183ee7e56438f96e6453d319f3df8e900678c (patch)
tree3c540b5fd3d20f1907f71b9a0bf13b7e3422a548 /clang/test
parent9ee1a1df242c3a11c9b9faaa3ecb2a6bb0e5ee86 (diff)
downloadbcm5719-llvm-cfd183ee7e56438f96e6453d319f3df8e900678c.tar.gz
bcm5719-llvm-cfd183ee7e56438f96e6453d319f3df8e900678c.zip
[Driver][Darwin] Disable default stack protector levels in freestanding mode.
Currently -fstack-protector is on by default when using -ffreestanding. Change the default behavior to have it off when using -ffreestanding. rdar://problem/14089363 llvm-svn: 289005
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Driver/stack-protector.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/test/Driver/stack-protector.c b/clang/test/Driver/stack-protector.c
index dad4d84b0de..6769b65f638 100644
--- a/clang/test/Driver/stack-protector.c
+++ b/clang/test/Driver/stack-protector.c
@@ -47,3 +47,16 @@
// SSP_MACOSX_KERNEL-NOT: "-stack-protector"
// RUN: %clang -target x86_64-apple-darwin10 -mmacosx-version-min=10.6 -### %s 2>&1 | FileCheck %s -check-prefix=SSP_MACOSX_10_6_KERNEL
// SSP_MACOSX_10_6_KERNEL: "-stack-protector" "1"
+
+// Test default stack protector values for Darwin platforms with -ffreestanding
+
+// RUN: %clang -ffreestanding -target armv7k-apple-watchos2.0 -### %s 2>&1 | FileCheck %s -check-prefix=SSP_FREE_WATCHOS
+// SSP_FREE_WATCHOS-NOT: "-stack-protector"
+// RUN: %clang -ffreestanding -target arm64-apple-ios8.0.0 -### %s 2>&1 | FileCheck %s -check-prefix=SSP_FREE_IOS
+// SSP_FREE_IOS-NOT: "-stack-protector"
+// RUN: %clang -ffreestanding -target x86_64-apple-darwin10 -mmacosx-version-min=10.6 -### %s 2>&1 | FileCheck %s -check-prefix=SSP_FREE_MACOSX
+// SSP_FREE_MACOSX-NOT: "-stack-protector"
+// RUN: %clang -ffreestanding -target x86_64-apple-darwin10 -mmacosx-version-min=10.5 -### %s 2>&1 | FileCheck %s -check-prefix=SSP_FREE_MACOSX_10_5
+// SSP_FREE_MACOSX_10_5-NOT: "-stack-protector"
+// RUN: %clang -ffreestanding -target x86_64-apple-darwin10 -mmacosx-version-min=10.6 -### %s 2>&1 | FileCheck %s -check-prefix=SSP_FREE_MACOSX_10_6_KERNEL
+// SSP_FREE_MACOSX_10_6_KERNEL-NOT: "-stack-protector"
OpenPOWER on IntegriCloud