brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.3 KiB · 3b0476d Raw
40 lines · c
1// RUN: %clang -target i386-unknown-linux -fstack-clash-protection -### %s 2>&1 | FileCheck %s -check-prefix=SCP-i3862// RUN: %clang -target i386-unknown-linux -fno-stack-clash-protection -fstack-clash-protection -### %s 2>&1 | FileCheck %s -check-prefix=SCP-i3863// RUN: %clang -target i386-unknown-linux -fstack-clash-protection -fno-stack-clash-protection -### %s 2>&1 | FileCheck %s -check-prefix=SCP-i386-NO4// SCP-i386: "-fstack-clash-protection"5// SCP-i386-NO-NOT: "-fstack-clash-protection"6 7// RUN: %clang -target x86_64-scei-linux -fstack-clash-protection -### %s 2>&1 | FileCheck %s -check-prefix=SCP-x868// RUN: %clang -target x86_64-unknown-freebsd -fstack-clash-protection -### %s 2>&1 | FileCheck %s -check-prefix=SCP-x869// SCP-x86: "-fstack-clash-protection"10 11// RUN: %clang -target armv7k-apple-linux -fstack-clash-protection -### %s 2>&1 | FileCheck %s -check-prefix=SCP-armv712// SCP-armv7-NOT: "-fstack-clash-protection"13// SCP-armv7: argument unused during compilation: '-fstack-clash-protection'14 15// RUN: %clang -target x86_64-unknown-linux -fstack-clash-protection -S -emit-llvm -o %t.ll %s 2>&1 | FileCheck %s -check-prefix=SCP-warn16// SCP-warn: warning: unable to protect inline asm that clobbers stack pointer against stack clash17 18// RUN: %clang -target x86_64-pc-unknown-linux -fstack-clash-protection -S -emit-llvm -o- %s | FileCheck %s -check-prefix=SCP-ll-linux6419// SCP-ll-linux64: attributes {{.*}} "probe-stack"="inline-asm"20 21// RUN: %clang -target x86_64-pc-windows-msvc -fstack-clash-protection -S -emit-llvm -o- %s 2>&1 | FileCheck %s -check-prefix=SCP-ll-win6422// SCP-ll-win64-NOT: attributes {{.*}} "probe-stack"="inline-asm"23// SCP-ll-win64: argument unused during compilation: '-fstack-clash-protection'24 25// RUN: %clang -target x86_64-unknown-fuchsia -fstack-clash-protection -### %s 2>&1 | FileCheck %s -check-prefix=SCP-FUCHSIA26// RUN: %clang -target aarch64-unknown-fuchsia -fstack-clash-protection -### %s 2>&1 | FileCheck %s -check-prefix=SCP-FUCHSIA27// RUN: %clang -target riscv64-unknown-fuchsia -fstack-clash-protection -### %s 2>&1 | FileCheck %s -check-prefix=SCP-FUCHSIA28// SCP-FUCHSIA: "-fstack-clash-protection"29 30int foo(int c) {31  int r;32  __asm__("sub %0, %%rsp"33          :34          : "rm"(c)35          : "rsp");36  __asm__("mov %%rsp, %0"37          : "=rm"(r)::);38  return r;39}40