new testcase for PR515
[oota-llvm.git] / test / Transforms / IndVarsSimplify / 2005-02-17-TruncateExprCrash.ll
1 ; RUN: llvm-as < %s | opt -indvars -disable-output
2
3 implementation   ; Functions:
4
5 declare void %q_atomic_increment()
6
7 declare void %_Z9qt_assertPKcS0_i()
8
9 void %_ZN13QMetaResourceC1EPKh() {
10 entry:
11         invoke void %_Z9qt_assertPKcS0_i( )
12                         to label %endif.1 unwind label %then.i.i551
13
14 then.i.i551:            ; preds = %entry
15         ret void
16
17 endif.1:                ; preds = %entry
18         br bool false, label %then.2, label %then.i.i
19
20 then.2:         ; preds = %endif.1
21         invoke void %q_atomic_increment( )
22                         to label %loopentry.0 unwind label %invoke_catch.6
23
24 invoke_catch.6:         ; preds = %then.2
25         ret void
26
27 loopentry.0:            ; preds = %then.2
28         br bool false, label %shortcirc_next.i, label %endif.3
29
30 endif.3:                ; preds = %loopentry.0
31         ret void
32
33 shortcirc_next.i:               ; preds = %loopentry.0
34         br bool false, label %_ZNK7QString2atEi.exit, label %then.i
35
36 then.i:         ; preds = %shortcirc_next.i
37         ret void
38
39 _ZNK7QString2atEi.exit:         ; preds = %shortcirc_next.i
40         br bool false, label %endif.4, label %then.4
41
42 then.4:         ; preds = %_ZNK7QString2atEi.exit
43         ret void
44
45 endif.4:                ; preds = %_ZNK7QString2atEi.exit
46         %tmp.115 = load ubyte* null             ; <ubyte> [#uses=1]
47         br bool false, label %loopexit.1, label %no_exit.0
48
49 no_exit.0:              ; preds = %no_exit.0, %endif.4
50         %bytes_in_len.4.5 = phi ubyte [ %dec, %no_exit.0 ], [ %tmp.115, %endif.4 ]              ; <ubyte> [#uses=1]
51         %off.5.5.in = phi int [ %off.5.5, %no_exit.0 ], [ 0, %endif.4 ]         ; <int> [#uses=1]
52         %off.5.5 = add int %off.5.5.in, 1               ; <int> [#uses=2]
53         %dec = add ubyte %bytes_in_len.4.5, 255         ; <ubyte> [#uses=2]
54         %tmp.123631 = seteq ubyte %dec, 0               ; <bool> [#uses=1]
55         br bool %tmp.123631, label %loopexit.1, label %no_exit.0
56
57 loopexit.1:             ; preds = %no_exit.0, %endif.4
58         %off.5.in.6 = phi int [ 0, %endif.4 ], [ %off.5.5, %no_exit.0 ]         ; <int> [#uses=0]
59         ret void
60
61 then.i.i:               ; preds = %endif.1
62         ret void
63 }