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
6 @.str = private unnamed_addr constant [4 x i8] c"%s\0A\00", align 1
8 ; Addr-of a variable passed into an invoke instruction.
10 ; Requires protector and stack restore after landing pad.
11 define i32 @foo() uwtable safestack personality ptr @__gxx_personality_v0 {
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
28 %0 = landingpad { ptr, i32 }
30 ; CHECK-NEXT: store ptr %[[STATICTOP]], ptr @__safestack_unsafe_stack_ptr
34 declare void @_Z3exceptPi(ptr)
35 declare i32 @__gxx_personality_v0(...)