[clang] [clang] Enable -fstack-clash-protection by default for Android (PR #209279)
Fangrui Song via cfe-commits
cfe-commits at lists.llvm.org
Mon Aug 17 09:56:32 PDT 2026
================
@@ -1,15 +1,20 @@
-// RUN: %clang -target i386-unknown-linux -fstack-clash-protection -### %s 2>&1 | FileCheck %s -check-prefix=SCP-i386
-// RUN: %clang -target i386-unknown-linux -fno-stack-clash-protection -fstack-clash-protection -### %s 2>&1 | FileCheck %s -check-prefix=SCP-i386
-// RUN: %clang -target i386-unknown-linux -fstack-clash-protection -fno-stack-clash-protection -### %s 2>&1 | FileCheck %s -check-prefix=SCP-i386-NO
-// SCP-i386: "-fstack-clash-protection"
-// SCP-i386-NO-NOT: "-fstack-clash-protection"
-
-// RUN: %clang -target x86_64-scei-linux -fstack-clash-protection -### %s 2>&1 | FileCheck %s -check-prefix=SCP-x86
-// RUN: %clang -target x86_64-unknown-freebsd -fstack-clash-protection -### %s 2>&1 | FileCheck %s -check-prefix=SCP-x86
-// SCP-x86: "-fstack-clash-protection"
-
-// RUN: %clang -target armv7k-apple-linux -fstack-clash-protection -### %s 2>&1 | FileCheck %s -check-prefix=SCP-armv7
-// SCP-armv7-NOT: "-fstack-clash-protection"
+// RUN: %clang -target i386-unknown-linux -fstack-clash-protection -### %s 2>&1 | FileCheck %s --check-prefix=ENABLED
+// RUN: %clang -target i386-unknown-linux -fno-stack-clash-protection -fstack-clash-protection -### %s 2>&1 | FileCheck %s --check-prefix=ENABLED
+// RUN: %clang -target i386-unknown-linux -fstack-clash-protection -fno-stack-clash-protection -### %s 2>&1 | FileCheck %s --check-prefix=DISABLED --implicit-check-not='"-fstack-clash-protection"'
+
+// RUN: %clang -target x86_64-scei-linux -fstack-clash-protection -### %s 2>&1 | FileCheck %s --check-prefix=ENABLED
+// RUN: %clang -target x86_64-unknown-freebsd -fstack-clash-protection -### %s 2>&1 | FileCheck %s --check-prefix=ENABLED
+
+// RUN: %clang -target x86_64-unknown-linux -### %s 2>&1 | FileCheck %s --check-prefix=DISABLED --implicit-check-not='"-fstack-clash-protection"'
----------------
MaskRay wrote:
For new tests, prefer `--target=` to the long deprecated `-target `
https://github.com/llvm/llvm-project/pull/209279
More information about the cfe-commits
mailing list