blob: cf2cc34de55f1259eefe18113a5cb1f62f3cb1bb [file] [log] [blame]
Chad Rosierdb3da832012-08-21 16:16:06 +00001// RUN: %clang -fno-stack-protector -### %s 2>&1 | FileCheck %s -check-prefix=NOSSP
2// NOSSP-NOT: "-stack-protector" "1"
3// NOSSP-NOT: "-stack-protector-buffer-size"
4
5// RUN: %clang -fstack-protector -### %s 2>&1 | FileCheck %s -check-prefix=SSP
6// SSP: "-stack-protector" "1"
7// SSP-NOT: "-stack-protector-buffer-size"
8
9// RUN: %clang -fstack-protector --param ssp-buffer-size=16 -### %s 2>&1 | FileCheck %s -check-prefix=SSP-BUF
10// SSP-BUF: "-stack-protector" "1"
11// SSP-BUF: "-stack-protector-buffer-size" "16"
Rafael Espindola044f7832013-06-05 04:28:55 +000012
13// RUN: %clang -target i386-pc-openbsd -### %s 2>&1 | FileCheck %s -check-prefix=OPENBSD
Rafael Espindola2d401f52014-05-22 12:52:35 +000014// OPENBSD: "-stack-protector" "2"
Rafael Espindola044f7832013-06-05 04:28:55 +000015
16// RUN: %clang -target i386-pc-openbsd -fno-stack-protector -### %s 2>&1 | FileCheck %s -check-prefix=OPENBSD_OFF
17// OPENBSD_OFF-NOT: "-stack-protector"
Josh Mageee0fc1a82014-02-11 01:35:14 +000018
19// RUN: %clang -fstack-protector-strong -### %s 2>&1 | FileCheck %s -check-prefix=SSP-STRONG
20// SSP-STRONG: "-stack-protector" "2"
21// SSP-STRONG-NOT: "-stack-protector-buffer-size"
22
23// RUN: %clang -fstack-protector-all -### %s 2>&1 | FileCheck %s -check-prefix=SSP-ALL
24// SSP-ALL: "-stack-protector" "3"
25// SSP-ALL-NOT: "-stack-protector-buffer-size"