25 lines · plain
1; RUN: opt -safe-stack -S -mtriple=i386-pc-linux-gnu < %s -o - | FileCheck %s2; RUN: opt -safe-stack -S -mtriple=x86_64-pc-linux-gnu < %s -o - | FileCheck %s3; RUN: opt -passes=safe-stack -S -mtriple=i386-pc-linux-gnu < %s -o - | FileCheck %s4; RUN: opt -passes=safe-stack -S -mtriple=x86_64-pc-linux-gnu < %s -o - | FileCheck %s5 6@.str = private unnamed_addr constant [4 x i8] c"%s\0A\00", align 17 8; Addr-of in select instruction9; safestack attribute10; Requires protector.11define void @foo() nounwind uwtable safestack {12entry:13 ; CHECK: __safestack_unsafe_stack_ptr14 %x = alloca double, align 815 %call = call double @testi_aux() nounwind16 store double %call, ptr %x, align 817 %cmp2 = fcmp ogt double %call, 0.000000e+0018 %y.1 = select i1 %cmp2, ptr %x, ptr null19 %call2 = call i32 (ptr, ...) @printf(ptr @.str, ptr %y.1)20 ret void21}22 23declare double @testi_aux()24declare i32 @printf(ptr, ...)25