39 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 phi instruction9; Requires protector.10define void @foo() nounwind uwtable safestack {11entry:12 ; CHECK: __safestack_unsafe_stack_ptr13 %x = alloca double, align 814 %call = call double @testi_aux() nounwind15 store double %call, ptr %x, align 816 %cmp = fcmp ogt double %call, 3.140000e+0017 br i1 %cmp, label %if.then, label %if.else18 19if.then: ; preds = %entry20 %call1 = call double @testi_aux() nounwind21 store double %call1, ptr %x, align 822 br label %if.end423 24if.else: ; preds = %entry25 %cmp2 = fcmp ogt double %call, 1.000000e+0026 br i1 %cmp2, label %if.then3, label %if.end427 28if.then3: ; preds = %if.else29 br label %if.end430 31if.end4: ; preds = %if.else, %if.then3, %if.then32 %y.0 = phi ptr [ null, %if.then ], [ %x, %if.then3 ], [ null, %if.else ]33 %call5 = call i32 (ptr, ...) @printf(ptr @.str, ptr %y.0) nounwind34 ret void35}36 37declare double @testi_aux()38declare i32 @printf(ptr, ...)39