2012-08-22 00:16:06 +08:00
|
|
|
// RUN: %clang -fno-stack-protector -### %s 2>&1 | FileCheck %s -check-prefix=NOSSP
|
2014-06-01 21:45:09 +08:00
|
|
|
// NOSSP-NOT: "-stack-protector"
|
2012-08-22 00:16:06 +08:00
|
|
|
// NOSSP-NOT: "-stack-protector-buffer-size"
|
|
|
|
|
2014-06-01 21:45:09 +08:00
|
|
|
// RUN: %clang -target i386-unknown-linux -fstack-protector -### %s 2>&1 | FileCheck %s -check-prefix=SSP
|
2012-08-22 00:16:06 +08:00
|
|
|
// SSP: "-stack-protector" "1"
|
|
|
|
// SSP-NOT: "-stack-protector-buffer-size"
|
|
|
|
|
2014-06-01 21:45:09 +08:00
|
|
|
// RUN: %clang -target i386-unknown-linux -fstack-protector --param ssp-buffer-size=16 -### %s 2>&1 | FileCheck %s -check-prefix=SSP-BUF
|
2012-08-22 00:16:06 +08:00
|
|
|
// SSP-BUF: "-stack-protector" "1"
|
|
|
|
// SSP-BUF: "-stack-protector-buffer-size" "16"
|
2013-06-05 12:28:55 +08:00
|
|
|
|
|
|
|
// RUN: %clang -target i386-pc-openbsd -### %s 2>&1 | FileCheck %s -check-prefix=OPENBSD
|
2014-05-22 20:52:35 +08:00
|
|
|
// OPENBSD: "-stack-protector" "2"
|
2013-06-05 12:28:55 +08:00
|
|
|
|
2014-05-23 06:57:39 +08:00
|
|
|
// RUN: %clang -target i386-pc-openbsd -fstack-protector -### %s 2>&1 | FileCheck %s -check-prefix=OPENBSD_SPS
|
|
|
|
// OPENBSD_SPS: "-stack-protector" "2"
|
|
|
|
|
2014-02-11 09:35:14 +08:00
|
|
|
// RUN: %clang -fstack-protector-strong -### %s 2>&1 | FileCheck %s -check-prefix=SSP-STRONG
|
|
|
|
// SSP-STRONG: "-stack-protector" "2"
|
|
|
|
// SSP-STRONG-NOT: "-stack-protector-buffer-size"
|
|
|
|
|
|
|
|
// RUN: %clang -fstack-protector-all -### %s 2>&1 | FileCheck %s -check-prefix=SSP-ALL
|
|
|
|
// SSP-ALL: "-stack-protector" "3"
|
|
|
|
// SSP-ALL-NOT: "-stack-protector-buffer-size"
|
2015-10-14 20:25:43 +08:00
|
|
|
|
|
|
|
// RUN: %clang -target x86_64-scei-ps4 -### %s 2>&1 | FileCheck %s -check-prefix=SSP-PS4
|
|
|
|
// RUN: %clang -target x86_64-scei-ps4 -fstack-protector -### %s 2>&1 | FileCheck %s -check-prefix=SSP-PS4
|
|
|
|
// SSP-PS4: "-stack-protector" "2"
|
|
|
|
// SSP-PS4-NOT: "-stack-protector-buffer-size"
|
|
|
|
|
|
|
|
// 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"
|
2016-12-08 07:20:30 +08:00
|
|
|
|
|
|
|
// Test default stack protector values for Darwin platforms
|
|
|
|
|
|
|
|
// RUN: %clang -target armv7k-apple-watchos2.0 -### %s 2>&1 | FileCheck %s -check-prefix=SSP_WATCHOS
|
2017-09-06 07:50:58 +08:00
|
|
|
// RUN: %clang -ffreestanding -target armv7k-apple-watchos2.0 -### %s 2>&1 | FileCheck %s -check-prefix=SSP_WATCHOS
|
2016-12-08 07:20:30 +08:00
|
|
|
// SSP_WATCHOS: "-stack-protector" "1"
|
|
|
|
// RUN: %clang -target arm64-apple-ios8.0.0 -### %s 2>&1 | FileCheck %s -check-prefix=SSP_IOS
|
2017-09-06 07:50:58 +08:00
|
|
|
// RUN: %clang -ffreestanding -target arm64-apple-ios8.0.0 -### %s 2>&1 | FileCheck %s -check-prefix=SSP_IOS
|
2016-12-08 07:20:30 +08:00
|
|
|
// 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
|
2017-09-06 07:50:58 +08:00
|
|
|
// RUN: %clang -ffreestanding -target x86_64-apple-darwin10 -mmacosx-version-min=10.6 -### %s 2>&1 | FileCheck %s -check-prefix=SSP_MACOSX
|
2016-12-08 07:20:30 +08:00
|
|
|
// 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
|
2017-09-06 07:50:58 +08:00
|
|
|
// RUN: %clang -ffreestanding -target x86_64-apple-darwin10 -mmacosx-version-min=10.5 -### %s 2>&1 | FileCheck %s -check-prefix=SSP_MACOSX_10_5
|
2016-12-08 07:20:30 +08:00
|
|
|
// 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
|
2017-09-06 07:50:58 +08:00
|
|
|
// RUN: %clang -ffreestanding -target x86_64-apple-darwin10 -mmacosx-version-min=10.6 -### %s 2>&1 | FileCheck %s -check-prefix=SSP_MACOSX_10_6_KERNEL
|
2016-12-08 07:20:30 +08:00
|
|
|
// SSP_MACOSX_10_6_KERNEL: "-stack-protector" "1"
|
2016-12-08 08:22:06 +08:00
|
|
|
|