1; RUN: opt -jump-threading -S < %s | FileCheck %s 2; rdar://7620633 3 4target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64" 5target triple = "x86_64-apple-darwin11.0" 6 7define void @test1(i8* %args, i32 %from_tty) nounwind optsize ssp { 8entry: 9 %tmp = call i8* @f3(void (i8*)* null, i8* null) nounwind ; <i8*> [#uses=1] 10 %tmp1 = icmp eq i8* %args, null ; <i1> [#uses=1] 11 br i1 %tmp1, label %bb2, label %bb 12 13; CHECK: entry: 14; CHECK-NEXT: %tmp = call i8* @f3 15; CHECK-NEXT: %tmp1 = icmp eq i8* %args, null 16; CHECK-NEXT: br i1 %tmp1, label %bb7, label %bb 17 18bb: ; preds = %entry 19 %tmp2 = call noalias i8** @buildargv(i8* %args) nounwind ; <i8**> [#uses=4] 20 %tmp3 = icmp eq i8** %tmp2, null ; <i1> [#uses=1] 21 br i1 %tmp3, label %bb2, label %bb1 22 23bb1: ; preds = %bb 24 call void @f2(i8** %tmp2) nounwind 25 br label %bb2 26 27bb2: ; preds = %bb1, %bb, %entry 28 %argv.0 = phi i8** [ %tmp2, %bb1 ], [ %tmp2, %bb ], [ undef, %entry ] ; <i8**> [#uses=4] 29 %tmp5 = icmp eq i8* %args, null ; <i1> [#uses=1] 30 %tmp6 = icmp eq i8** %argv.0, null ; <i1> [#uses=1] 31 %tmp7 = or i1 %tmp5, %tmp6 ; <i1> [#uses=1] 32 br i1 %tmp7, label %bb7, label %bb5 33 34bb5: ; preds = %bb2 35 %tmp8 = load i8*, i8** %argv.0, align 8 ; <i8*> [#uses=1] 36 %tmp9 = icmp eq i8* %tmp8, null ; <i1> [#uses=1] 37 br i1 %tmp9, label %bb7, label %bb6 38 39bb6: ; preds = %bb5 40 %tmp10 = load i8*, i8** %argv.0, align 8 ; <i8*> [#uses=1] 41 %tmp11 = load i8, i8* %tmp10, align 1 ; <i8> [#uses=1] 42 %tmp12 = icmp eq i8 %tmp11, 0 ; <i1> [#uses=1] 43 br i1 %tmp12, label %bb7, label %bb8 44 45bb7: ; preds = %bb6, %bb5, %bb2 46 call void @f1() nounwind optsize ssp 47 br label %bb9 48 49bb8: ; preds = %bb6 50 %tmp13 = load i8*, i8** %argv.0, align 8 ; <i8*> [#uses=1] 51 %tmp14 = call i64 @f5(i8* %tmp13) nounwind ; <i64> [#uses=0] 52 br label %bb9 53 54bb9: ; preds = %bb8, %bb7 55 call void @f4(i8* %tmp) nounwind 56 ret void 57} 58 59declare noalias i8** @buildargv(i8*) 60 61declare void @f2(i8**) 62 63declare void @f4(i8*) 64 65declare i8* @f3(void (i8*)*, i8*) 66 67declare void @f1() 68 69declare i64 @f5(i8*) 70