[Driver] Add tests for default stack protector values on Darwin
authorBruno Cardoso Lopes <bruno.cardoso@gmail.com>
Wed, 7 Dec 2016 23:20:30 +0000 (23:20 +0000)
committerBruno Cardoso Lopes <bruno.cardoso@gmail.com>
Wed, 7 Dec 2016 23:20:30 +0000 (23:20 +0000)
llvm-svn: 288994

clang/test/Driver/stack-protector.c

index 487af56..dad4d84 100644 (file)
 // RUN: %clang -target x86_64-scei-ps4 -fstack-protector --param ssp-buffer-size=16 -### %s 2>&1 | FileCheck %s -check-prefix=SSP-PS4-BUF
 // SSP-PS4-BUF: "-stack-protector" "2"
 // SSP-PS4-BUF: "-stack-protector-buffer-size" "16"
+
+// Test default stack protector values for Darwin platforms
+
+// RUN: %clang -target armv7k-apple-watchos2.0 -### %s 2>&1 | FileCheck %s -check-prefix=SSP_WATCHOS
+// SSP_WATCHOS: "-stack-protector" "1"
+// RUN: %clang -target arm64-apple-ios8.0.0 -### %s 2>&1 | FileCheck %s -check-prefix=SSP_IOS
+// SSP_IOS: "-stack-protector" "1"
+// RUN: %clang -target x86_64-apple-darwin10 -mmacosx-version-min=10.6 -### %s 2>&1 | FileCheck %s -check-prefix=SSP_MACOSX
+// SSP_MACOSX: "-stack-protector" "1"
+// RUN: %clang -target x86_64-apple-darwin10 -mmacosx-version-min=10.5 -### %s 2>&1 | FileCheck %s -check-prefix=SSP_MACOSX_10_5
+// SSP_MACOSX_10_5: "-stack-protector" "1"
+// RUN: %clang -target x86_64-apple-darwin10 -mmacosx-version-min=10.5 -mkernel -### %s 2>&1 | FileCheck %s -check-prefix=SSP_MACOSX_KERNEL
+// 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"