Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CodeGen / stack-protector-guard.c
blob5839ab06033a15eb20e398c81814ac0a660db0c8
1 // RUN: %clang_cc1 -mstack-protector-guard=sysreg -triple x86_64-linux-gnu \
2 // RUN: -mstack-protector-guard-offset=1024 -emit-llvm %s -o - | FileCheck %s
3 // RUN: %clang_cc1 -mstack-protector-guard=sysreg -triple powerpc64le-linux-gnu \
4 // RUN: -mstack-protector-guard-offset=1024 -emit-llvm %s -o - | FileCheck %s
5 // RUN: %clang_cc1 -mstack-protector-guard=sysreg -triple arm-linux-gnueabi \
6 // RUN: -mstack-protector-guard-offset=1024 -emit-llvm %s -o - | FileCheck %s
7 // RUN: %clang_cc1 -mstack-protector-guard=sysreg -triple thumbv7-linux-gnueabi \
8 // RUN: -mstack-protector-guard-offset=1024 -emit-llvm %s -o - | FileCheck %s
9 // RUN: %clang_cc1 -mstack-protector-guard=sysreg -triple aarch64-linux-gnu \
10 // RUN: -mstack-protector-guard-offset=1024 -mstack-protector-guard-reg=sp_el0 \
11 // RUN: -emit-llvm %s -o - | FileCheck %s --check-prefix=AARCH64
12 void foo(int*);
13 void bar(int x) {
14 int baz[x];
15 foo(baz);
18 // CHECK: !llvm.module.flags = !{{{.*}}[[ATTR1:![0-9]+]], [[ATTR2:![0-9]+]]}
19 // CHECK: [[ATTR1]] = !{i32 1, !"stack-protector-guard", !"sysreg"}
20 // CHECK: [[ATTR2]] = !{i32 1, !"stack-protector-guard-offset", i32 1024}
22 // AARCH64: !llvm.module.flags = !{{{.*}}[[ATTR1:![0-9]+]], [[ATTR2:![0-9]+]], [[ATTR3:![0-9]+]]}
23 // AARCH64: [[ATTR1]] = !{i32 1, !"stack-protector-guard", !"sysreg"}
24 // AARCH64: [[ATTR2]] = !{i32 1, !"stack-protector-guard-reg", !"sp_el0"}
25 // AARCH64: [[ATTR3]] = !{i32 1, !"stack-protector-guard-offset", i32 1024}