Debian Codegraph @

llvm/test/Transforms/SafeStack/X86/invoke.ll

raw
1 ; RUN: opt -safe-stack -S -mtriple=i386-pc-linux-gnu < %s -o - | FileCheck %s
2 ; RUN: opt -safe-stack -S -mtriple=x86_64-pc-linux-gnu < %s -o - | FileCheck %s
3 ; RUN: opt -passes=safe-stack -S -mtriple=i386-pc-linux-gnu < %s -o - | FileCheck %s
4 ; RUN: opt -passes=safe-stack -S -mtriple=x86_64-pc-linux-gnu < %s -o - | FileCheck %s
5
6 @.str = private unnamed_addr constant [4 x i8] c"%s\0A\00", align 1
7
8 ; Addr-of a variable passed into an invoke instruction.
9 ; safestack attribute
10 ; Requires protector and stack restore after landing pad.
11 define i32 @foo() uwtable safestack personality ptr @__gxx_personality_v0 {
12 entry:
13 ; CHECK: %[[SP:.*]] = load ptr, ptr @__safestack_unsafe_stack_ptr
14 ; CHECK: %[[STATICTOP:.*]] = getelementptr i8, ptr %[[SP]], i32 -16
15 %a = alloca i32, align 4
16 %exn.slot = alloca ptr
17 %ehselector.slot = alloca i32
18 store i32 0, ptr %a, align 4
19 invoke void @_Z3exceptPi(ptr %a)
20 to label %invoke.cont unwind label %lpad
21
22 invoke.cont:
23 ret i32 0
24
25 lpad:
26 ; CHECK: landingpad
27 ; CHECK-NEXT: catch
28 %0 = landingpad { ptr, i32 }
29 catch ptr null
30 ; CHECK-NEXT: store ptr %[[STATICTOP]], ptr @__safestack_unsafe_stack_ptr
31 ret i32 0
32 }
33
34 declare void @_Z3exceptPi(ptr)
35 declare i32 @__gxx_personality_v0(...)