annotate clang/test/CodeGen/stack-clash-protection.c @ 150:1d019706d866

LLVM10
author anatofuz
date Thu, 13 Feb 2020 15:10:13 +0900
parents
children 2e18cbf3894f
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
anatofuz
parents:
diff changeset
3
anatofuz
parents:
diff changeset
4 // CHECK: define void @large_stack() #[[A:.*]] {
anatofuz
parents:
diff changeset
5 void large_stack() {
anatofuz
parents:
diff changeset
6 volatile int stack[20000], i;
anatofuz
parents:
diff changeset
7 for (i = 0; i < sizeof(stack) / sizeof(int); ++i)
anatofuz
parents:
diff changeset
8 stack[i] = i;
anatofuz
parents:
diff changeset
9 }
anatofuz
parents:
diff changeset
10
anatofuz
parents:
diff changeset
11 // CHECK: define void @vla({{.*}}) #[[A:.*]] {
anatofuz
parents:
diff changeset
12 void vla(int n) {
anatofuz
parents:
diff changeset
13 volatile int vla[n];
anatofuz
parents:
diff changeset
14 __builtin_memset(&vla[0], 0, 1);
anatofuz
parents:
diff changeset
15 }
anatofuz
parents:
diff changeset
16
anatofuz
parents:
diff changeset
17 // CHECK: define void @builtin_alloca({{.*}}) #[[A:.*]] {
anatofuz
parents:
diff changeset
18 void builtin_alloca(int n) {
anatofuz
parents:
diff changeset
19 volatile void *mem = __builtin_alloca(n);
anatofuz
parents:
diff changeset
20 }
anatofuz
parents:
diff changeset
21
anatofuz
parents:
diff changeset
22 // CHECK: attributes #[[A]] = {{.*}} "probe-stack"="inline-asm"