blob: e12453a76c41c1b703a683274aa79eb89f4b506e [file] [log] [blame]
Nick Lewycky0c4edc72007-09-20 00:57:00 +00001; RUN: llvm-as < %s | opt -predsimplify | llvm-dis | grep unreachable | count 2
Nick Lewycky56d24822007-09-20 00:48:36 +00002; PR1683
3
4@.str = internal constant [13 x i8] c"c36174a.adb\00\00" ; <[13 x i8]*> [#uses=1]
5
6define void @_ada_c36174a() {
7entry:
8 %tmp3 = call i8* @llvm.stacksave( ) ; <i8*> [#uses=1]
9 %tmp4 = invoke i32 @report__ident_int( i32 6 )
10 to label %invcont unwind label %entry.lpad_crit_edge ; <i32> [#uses=7]
11
12entry.lpad_crit_edge: ; preds = %entry
13 br label %lpad
14
15invcont: ; preds = %entry
16 %tmp6 = icmp slt i32 %tmp4, 1 ; <i1> [#uses=1]
17 br i1 %tmp6, label %bb, label %bb9
18
19bb: ; preds = %invcont
20 invoke void @__gnat_rcheck_07( i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i32 10 )
21 to label %invcont8 unwind label %bb.lpad_crit_edge
22
23bb.lpad_crit_edge: ; preds = %bb
24 br label %lpad
25
26invcont8: ; preds = %bb
27 unreachable
28
29bb9: ; preds = %invcont
30 %tmp51 = add i32 %tmp4, 6 ; <i32> [#uses=2]
31 %tmp56 = icmp sgt i32 %tmp4, %tmp51 ; <i1> [#uses=1]
32 br i1 %tmp56, label %bb9.bb76_crit_edge, label %bb9.bb61_crit_edge
33
34bb9.bb61_crit_edge: ; preds = %bb9
35 br label %bb61
36
37bb9.bb76_crit_edge: ; preds = %bb9
38 br label %bb76
39
40bb61: ; preds = %bb73, %bb9.bb61_crit_edge
41 %J4b.0 = phi i32 [ %tmp75, %bb73 ], [ %tmp4, %bb9.bb61_crit_edge ] ; <i32> [#uses=2]
42 %tmp70 = icmp eq i32 %tmp51, %J4b.0 ; <i1> [#uses=1]
43 br i1 %tmp70, label %bb61.bb76_crit_edge, label %bb73
44
45bb61.bb76_crit_edge: ; preds = %bb61
46 br label %bb76
47
48bb73: ; preds = %bb61
49 %tmp75 = add i32 %J4b.0, 1 ; <i32> [#uses=1]
50 br label %bb61
51
52bb76: ; preds = %bb61.bb76_crit_edge, %bb9.bb76_crit_edge
53 %tmp78 = icmp ne i32 %tmp4, 6 ; <i1> [#uses=1]
54 %tmp81 = add i32 %tmp4, 6 ; <i32> [#uses=1]
55 %tmp8182 = sext i32 %tmp81 to i64 ; <i64> [#uses=1]
56 %tmp8384 = sext i32 %tmp4 to i64 ; <i64> [#uses=1]
57 %tmp85 = sub i64 %tmp8182, %tmp8384 ; <i64> [#uses=1]
58 %tmp86 = icmp ne i64 %tmp85, 6 ; <i1> [#uses=1]
59 %tmp90 = or i1 %tmp78, %tmp86 ; <i1> [#uses=1]
60 br i1 %tmp90, label %bb93, label %bb76.bb99_crit_edge
61
62bb76.bb99_crit_edge: ; preds = %bb76
63 br label %bb99
64
65bb93: ; preds = %bb76
66 invoke void @abort( )
67 to label %bb93.bb99_crit_edge unwind label %bb93.lpad_crit_edge
68
69bb93.lpad_crit_edge: ; preds = %bb93
70 br label %lpad
71
72bb93.bb99_crit_edge: ; preds = %bb93
73 br label %bb99
74
75bb99: ; preds = %bb93.bb99_crit_edge, %bb76.bb99_crit_edge
76 ret void
77
78lpad: ; preds = %bb93.lpad_crit_edge, %bb.lpad_crit_edge, %entry.lpad_crit_edge
79 %eh_ptr = call i8* @llvm.eh.exception( ) ; <i8*> [#uses=2]
80 %eh_select102 = call i32 (i8*, i8*, ...)* @llvm.eh.selector.i32( i8* %eh_ptr, i8* bitcast (i32 (...)* @__gnat_eh_personality to i8*), i32 0 ) ; <i32> [#uses=0]
81 call void @llvm.stackrestore( i8* %tmp3 )
82 call i32 (...)* @_Unwind_Resume( i8* %eh_ptr ) ; <i32>:0 [#uses=0]
83 unreachable
84}
85
86declare i8* @llvm.stacksave()
87
88declare i32 @report__ident_int(i32)
89
90declare void @__gnat_rcheck_07(i8*, i32)
91
92declare void @abort()
93
94declare i8* @llvm.eh.exception()
95
96declare i32 @llvm.eh.selector.i32(i8*, i8*, ...)
97
98declare i32 @__gnat_eh_personality(...)
99
100declare i32 @_Unwind_Resume(...)
101
102declare void @llvm.stackrestore(i8*)