Use the llvm-upgrade program to upgrade llvm assembly.
[oota-llvm.git] / test / Transforms / SimplifyCFG / 2005-08-03-PHIFactorCrash.ll
1 ; RUN: llvm-upgrade < %s | llvm-as | opt -simplifycfg -disable-output
2
3         %arraytype.1.Char = type { int, [0 x sbyte] }
4         %arraytype.4.Signed = type { int, [0 x int] }
5         %functiontype.23 = type %structtype.Task* (%structtype.Task*, %structtype.Packet*, %structtype.FailedRun*)
6         %functiontype.27 = type %structtype.object* ()
7         %functiontype.28 = type bool (%structtype.object*, %structtype.object_vtable*)
8         %functiontype.39 = type int (%structtype.listiter*)
9         %opaquetype.RuntimeTypeInfo = type sbyte* (sbyte*)
10         %structtype.AssertionError_vtable = type { %structtype.FailedRun_vtable }
11         %structtype.DeviceTask = type { %structtype.Task }
12         %structtype.FailedRun = type { %structtype.object }
13         %structtype.FailedRun_vtable = type { %structtype.object_vtable }
14         %structtype.Packet = type { %structtype.object, %structtype.list.1*, int, int, int, %structtype.Packet* }
15         %structtype.Task = type { %structtype.TaskState, %structtype.FailedRun*, int, %structtype.Packet*, %structtype.Task*, int }
16         %structtype.TaskState = type { %structtype.object, bool, bool, bool }
17         %structtype.list.1 = type { %arraytype.4.Signed* }
18         %structtype.listiter = type { %structtype.list.1*, int }
19         %structtype.object = type { %structtype.object_vtable* }
20         %structtype.object_vtable = type { %structtype.object_vtable*, %opaquetype.RuntimeTypeInfo*, %arraytype.1.Char*, %functiontype.27* }
21 %structinstance.59 = external global %structtype.AssertionError_vtable          ; <%structtype.AssertionError_vtable*> [#uses=0]
22
23 implementation   ; Functions:
24
25 declare fastcc bool %ll_isinstance__objectPtr_object_vtablePtr()
26
27 declare fastcc void %ll_listnext__listiterPtr()
28
29 fastcc void %WorkTask.fn() {
30 block0:
31         br label %block1
32
33 block1:         ; preds = %block0
34         %v2542 = call fastcc bool %ll_isinstance__objectPtr_object_vtablePtr( )         ; <bool> [#uses=1]
35         br bool %v2542, label %block4, label %block2
36
37 block2:         ; preds = %block1
38         br label %block3
39
40 block3:         ; preds = %block2
41         unwind
42
43 block4:         ; preds = %block1
44         br label %block5
45
46 block5:         ; preds = %block4
47         %v2565 = seteq %structtype.Packet* null, null           ; <bool> [#uses=1]
48         br bool %v2565, label %block15, label %block6
49
50 block6:         ; preds = %block5
51         %self_2575 = phi %structtype.DeviceTask* [ null, %block5 ]              ; <%structtype.DeviceTask*> [#uses=1]
52         br bool false, label %block14, label %block7
53
54 block7:         ; preds = %block14, %block6
55         %self_2635 = phi %structtype.DeviceTask* [ %self_2575, %block6 ], [ null, %block14 ]            ; <%structtype.DeviceTask*> [#uses=1]
56         %tmp.124 = getelementptr %structtype.Packet* null, int 0, uint 2                ; <int*> [#uses=0]
57         br label %block8
58
59 block8:         ; preds = %block10, %block7
60         %self_2672 = phi %structtype.DeviceTask* [ %self_2635, %block7 ], [ null, %block10 ]            ; <%structtype.DeviceTask*> [#uses=0]
61         invoke fastcc void %ll_listnext__listiterPtr( )
62                         to label %block9 unwind label %block8_exception_handling
63
64 block8_exception_handling:              ; preds = %block8
65         br bool false, label %block8_exception_found_branchto_block12, label %block8_not_exception_structinstance.10
66
67 block8_not_exception_structinstance.10:         ; preds = %block8_exception_handling
68         unwind
69
70 block8_exception_found_branchto_block12:                ; preds = %block8_exception_handling
71         br label %block12
72
73 block9:         ; preds = %block8
74         br bool false, label %block11, label %block10
75
76 block10:                ; preds = %block11, %block9
77         br label %block8
78
79 block11:                ; preds = %block9
80         br label %block10
81
82 block12:                ; preds = %block8_exception_found_branchto_block12
83         br label %block13
84
85 block13:                ; preds = %block15, %block12
86         ret void
87
88 block14:                ; preds = %block6
89         br label %block7
90
91 block15:                ; preds = %block5
92         %v2586 = phi %structtype.DeviceTask* [ null, %block5 ]          ; <%structtype.DeviceTask*> [#uses=0]
93         br label %block13
94 }