diff --git a/test/Driver/stack-protector.c b/test/Driver/stack-protector.c index 487af569f248ebc10b374f9c114bd5bae5b1b2e9..dad4d84b0def2acee76849ac29f02b0df13f1c2f 100644 --- a/test/Driver/stack-protector.c +++ b/test/Driver/stack-protector.c @@ -32,3 +32,18 @@ // 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"