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 ; PtrToInt/IntToPtr Cast
10 define void @IntToPtr() nounwind uwtable safestack {
12 ; CHECK-LABEL: @IntToPtr(
13 ; CHECK-NOT: __safestack_unsafe_stack_ptr
15 %a = alloca i32, align 4
16 %0 = ptrtoint ptr %a to i64
17 %1 = inttoptr i64 %0 to ptr
21 define i8 @BitCastNarrow() nounwind uwtable safestack {
23 ; CHECK-LABEL: @BitCastNarrow(
24 ; CHECK-NOT: __safestack_unsafe_stack_ptr
26 %a = alloca i32, align 4
27 %0 = load i8, ptr %a, align 1
31 define i64 @BitCastWide() nounwind uwtable safestack {
33 ; CHECK-LABEL: @BitCastWide(
34 ; CHECK: __safestack_unsafe_stack_ptr
36 %a = alloca i32, align 4
37 %0 = load i64, ptr %a, align 1