brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.3 KiB · b07e4c4 Raw
30 lines · c
1// Check the correct function attributes are generated2// RUN: %clang_cc1 -triple x86_64-linux -O0 -emit-llvm -o- %s -fstack-clash-protection -mstack-probe-size=8192 | FileCheck %s3// RUN: %clang_cc1 -triple s390x-linux-gnu -O0 -emit-llvm -o- %s -fstack-clash-protection -mstack-probe-size=8192 | FileCheck %s4// RUN: %clang_cc1 -triple powerpc64le-linux-gnu -O0 -emit-llvm -o- %s -fstack-clash-protection -mstack-probe-size=8192 | FileCheck %s5// RUN: %clang_cc1 -triple powerpc64-linux-gnu -O0 -emit-llvm -o- %s -fstack-clash-protection -mstack-probe-size=8192 | FileCheck %s6// RUN: %clang_cc1 -triple aarch64-linux-gnu -O0 -emit-llvm -o- %s -fstack-clash-protection -mstack-probe-size=8192 | FileCheck %s7 8// CHECK: define{{.*}} void @large_stack() #[[A:.*]] {9void large_stack(void) {10  volatile int stack[20000], i;11  for (i = 0; i < sizeof(stack) / sizeof(int); ++i)12    stack[i] = i;13}14 15// CHECK: define{{.*}} void @vla({{.*}}) #[[A]] {16void vla(int n) {17  volatile int vla[n];18  __builtin_memset(&vla[0], 0, 1);19}20 21// CHECK: define{{.*}} void @builtin_alloca({{.*}}) #[[A]] {22void builtin_alloca(int n) {23  volatile void *mem = __builtin_alloca(n);24}25 26// CHECK: attributes #[[A]] = {{.*}}"probe-stack"="inline-asm" {{.*}}"stack-probe-size"="8192"27 28// CHECK: !{i32 4, !"probe-stack", !"inline-asm"}29// CHECK: !{i32 8, !"stack-probe-size", i32 8192}30