annotate clang/test/CodeGen/stack-clash-protection.c @ 207:2e18cbf3894f

LLVM12
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 08 Jun 2021 06:07:14 +0900
parents 1d019706d866
children c4bab56944e8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // Check the correct function attributes are generated
anatofuz
parents:
diff changeset
2 // RUN: %clang_cc1 -triple x86_64-linux -O0 -S -emit-llvm -o- %s -fstack-clash-protection | FileCheck %s
207
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
3 // RUN: %clang_cc1 -triple s390x-linux-gnu -O0 -S -emit-llvm -o- %s -fstack-clash-protection | FileCheck %s
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
4 // RUN: %clang_cc1 -triple powerpc64le-linux-gnu -O0 -S -emit-llvm -o- %s -fstack-clash-protection | FileCheck %s
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
5 // RUN: %clang_cc1 -triple powerpc64-linux-gnu -O0 -S -emit-llvm -o- %s -fstack-clash-protection | FileCheck %s
150
anatofuz
parents:
diff changeset
6
207
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
7 // CHECK: define{{.*}} void @large_stack() #[[A:.*]] {
150
anatofuz
parents:
diff changeset
8 void large_stack() {
anatofuz
parents:
diff changeset
9 volatile int stack[20000], i;
anatofuz
parents:
diff changeset
10 for (i = 0; i < sizeof(stack) / sizeof(int); ++i)
anatofuz
parents:
diff changeset
11 stack[i] = i;
anatofuz
parents:
diff changeset
12 }
anatofuz
parents:
diff changeset
13
207
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
14 // CHECK: define{{.*}} void @vla({{.*}}) #[[A:.*]] {
150
anatofuz
parents:
diff changeset
15 void vla(int n) {
anatofuz
parents:
diff changeset
16 volatile int vla[n];
anatofuz
parents:
diff changeset
17 __builtin_memset(&vla[0], 0, 1);
anatofuz
parents:
diff changeset
18 }
anatofuz
parents:
diff changeset
19
207
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
20 // CHECK: define{{.*}} void @builtin_alloca({{.*}}) #[[A:.*]] {
150
anatofuz
parents:
diff changeset
21 void builtin_alloca(int n) {
anatofuz
parents:
diff changeset
22 volatile void *mem = __builtin_alloca(n);
anatofuz
parents:
diff changeset
23 }
anatofuz
parents:
diff changeset
24
anatofuz
parents:
diff changeset
25 // CHECK: attributes #[[A]] = {{.*}} "probe-stack"="inline-asm"