1; RUN: opt < %s -newgvn 2; PR7052 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-unknown-linux-gnu" 6 7define i32 @main(i32 %argc, i8** nocapture %argv) personality i32 (...)* @__gxx_personality_v0 { 8entry: 9 %0 = getelementptr inbounds i8, i8* undef, i64 5 ; <i8*> [#uses=1] 10 %1 = bitcast i8* %0 to i32* ; <i32*> [#uses=1] 11 store i32 undef, i32* %1, align 1 12 br i1 undef, label %k121.i.i, label %l117.i.i 13 14l117.i.i: ; preds = %entry 15 invoke fastcc void @foo() 16 to label %.noexc5 unwind label %landing_pad 17 18.noexc5: ; preds = %l117.i.i 19 unreachable 20 21k121.i.i: ; preds = %entry 22 br i1 undef, label %l129.i.i, label %k133.i.i 23 24l129.i.i: ; preds = %k121.i.i 25 invoke fastcc void @foo() 26 to label %.noexc7 unwind label %landing_pad 27 28.noexc7: ; preds = %l129.i.i 29 unreachable 30 31k133.i.i: ; preds = %k121.i.i 32 %2 = getelementptr i8, i8* undef, i64 5 ; <i8*> [#uses=1] 33 %3 = bitcast i8* %2 to i1* ; <i1*> [#uses=1] 34 %4 = load i1, i1* %3 ; <i1> [#uses=1] 35 br i1 %4, label %k151.i.i, label %l147.i.i 36 37l147.i.i: ; preds = %k133.i.i 38 invoke fastcc void @foo() 39 to label %.noexc10 unwind label %landing_pad 40 41.noexc10: ; preds = %l147.i.i 42 unreachable 43 44k151.i.i: ; preds = %k133.i.i 45 ret i32 0 46 47landing_pad: ; preds = %l147.i.i, %l129.i.i, %l117.i.i 48 %exn = landingpad {i8*, i32} 49 cleanup 50 switch i32 undef, label %fin [ 51 i32 1, label %catch1 52 i32 2, label %catch 53 ] 54 55fin: ; preds = %landing_pad 56 unreachable 57 58catch: ; preds = %landing_pad 59 ret i32 1 60 61catch1: ; preds = %landing_pad 62 ret i32 2 63} 64 65declare fastcc void @foo() 66 67declare i32 @__gxx_personality_v0(...) 68