1 ; RUN: opt < %s -simplifycfg -S | not grep select 2 ; ModuleID = '<stdin>' 3 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128" 4 target triple = "i386-apple-darwin10.0" 5 module asm ".globl _foo" 6 module asm "_foo: ret" 7 module asm ".globl _i" 8 module asm ".set _i, 0" 9 @i = extern_weak global i32 ; <i32*> [#uses=2] 10 @j = common global i32 0 ; <i32*> [#uses=1] 11 @ed = common global double 0.000000e+00, align 8 ; <double*> [#uses=1] 12 13 define i32 @main() nounwind ssp { 14 entry: 15 br label %bb4 16 17 bb: ; preds = %bb4 18 br i1 icmp ne (i32* @i, i32* null), label %bb1, label %bb2 19 20 bb1: ; preds = %bb 21 %0 = load i32, i32* @i, align 4 ; <i32> [#uses=1] 22 br label %bb3 23 24 bb2: ; preds = %bb 25 br label %bb3 26 27 bb3: ; preds = %bb2, %bb1 28 %storemerge = phi i32 [ %0, %bb1 ], [ 0, %bb2 ] ; <i32> [#uses=2] 29 store i32 %storemerge, i32* @j 30 %1 = sitofp i32 %storemerge to double ; <double> [#uses=1] 31 %2 = call double @sin(double %1) nounwind readonly ; <double> [#uses=1] 32 %3 = fadd double %2, %d.0 ; <double> [#uses=1] 33 %4 = add i32 %l.0, 1 ; <i32> [#uses=1] 34 br label %bb4 35 36 bb4: ; preds = %bb3, %entry 37 %d.0 = phi double [ undef, %entry ], [ %3, %bb3 ] ; <double> [#uses=2] 38 %l.0 = phi i32 [ 0, %entry ], [ %4, %bb3 ] ; <i32> [#uses=2] 39 %5 = icmp sgt i32 %l.0, 99 ; <i1> [#uses=1] 40 br i1 %5, label %bb5, label %bb 41 42 bb5: ; preds = %bb4 43 store double %d.0, double* @ed, align 8 44 ret i32 0 45 } 46 47 declare double @sin(double) nounwind readonly 48