1 ; RUN: llvm-as < %s | llvm-dis > %t.orig
2 ; RUN: llvm-as < %s | llvm-c-test --echo > %t.echo
3 ; RUN: diff -w %t.orig %t.echo
5 %C6object9ClassInfo = type { ptr, ptr }
6 %C6object9ClassInfo__vtbl = type { ptr }
7 %C6object9Exception__vtbl = type { ptr }
8 %C6object6Object = type { ptr }
9 %C6object6Object__vtbl = type { ptr }
10 %C6object9Throwable = type { ptr }
11 %C6object9Throwable__vtbl = type { ptr }
13 @C6object9ClassInfo__ClassInfo = linkonce_odr constant %C6object9ClassInfo { ptr @C6object9ClassInfo__vtblZ, ptr @C6object8TypeInfo__ClassInfo }
14 @C6object9ClassInfo__vtblZ = linkonce_odr constant %C6object9ClassInfo__vtbl { ptr @C6object9ClassInfo__ClassInfo }
15 @C6object8TypeInfo__ClassInfo = linkonce_odr constant %C6object9ClassInfo { ptr @C6object9ClassInfo__vtblZ, ptr @C6object6Object__ClassInfo }
16 @C6object6Object__ClassInfo = linkonce_odr constant %C6object9ClassInfo { ptr @C6object9ClassInfo__vtblZ, ptr @C6object6Object__ClassInfo }
17 @C6object9Throwable__ClassInfo = linkonce_odr constant %C6object9ClassInfo { ptr @C6object9ClassInfo__vtblZ, ptr @C6object6Object__ClassInfo }
18 @C6object9Exception__ClassInfo = linkonce_odr constant %C6object9ClassInfo { ptr @C6object9ClassInfo__vtblZ, ptr @C6object9Throwable__ClassInfo }
19 @C6object9Exception__vtblZ = linkonce_odr constant %C6object9Exception__vtbl { ptr @C6object9Exception__ClassInfo }
20 @C6object5Error__ClassInfo = linkonce_odr constant %C6object9ClassInfo { ptr @C6object9ClassInfo__vtblZ, ptr @C6object9Throwable__ClassInfo }
22 define i32 @_D8test01494mainFMZi() personality ptr @__sd_eh_personality {
24 %0 = invoke noalias ptr @_d_allocmemory(i64 8)
25 to label %then unwind label %landingPad
28 store ptr bitcast (ptr @C6object9Exception__vtblZ to ptr), ptr %0, align 8
29 invoke void @_D6object6Object6__ctorFMC6object6ObjectZv(ptr %0)
30 to label %then1 unwind label %landingPad
32 then1: ; preds = %then
33 invoke void @__sd_eh_throw(ptr nonnull %0)
34 to label %then2 unwind label %landingPad
36 then2: ; preds = %then1
39 landingPad: ; preds = %then1, %then, %body
40 %1 = landingpad { ptr, i32 }
42 catch ptr @C6object5Error__ClassInfo
43 catch ptr @C6object9Exception__ClassInfo
44 catch ptr @C6object9Throwable__ClassInfo
45 %2 = extractvalue { ptr, i32 } %1, 1
46 %3 = tail call i32 @llvm.eh.typeid.for(ptr nonnull bitcast (ptr @C6object5Error__ClassInfo to ptr))
47 %4 = icmp eq i32 %3, %2
48 br i1 %4, label %catch, label %unwind3
50 catch: ; preds = %unwind5, %unwind3, %landingPad
51 %merge = phi i32 [ 23, %landingPad ], [ 19, %unwind3 ], [ 13, %unwind5 ]
54 unwind3: ; preds = %landingPad
55 %5 = tail call i32 @llvm.eh.typeid.for(ptr nonnull @C6object9Exception__ClassInfo)
56 %6 = icmp eq i32 %5, %2
57 br i1 %6, label %catch, label %unwind5
59 unwind5: ; preds = %unwind3
60 %7 = tail call i32 @llvm.eh.typeid.for(ptr nonnull @C6object9Throwable__ClassInfo)
61 %8 = icmp eq i32 %7, %2
62 br i1 %8, label %catch, label %unwind7
64 unwind7: ; preds = %unwind5
65 resume { ptr, i32 } %1
68 declare void @_D6object6Object6__ctorFMC6object6ObjectZv(ptr)
70 declare noalias ptr @_d_allocmemory(i64)
72 declare i32 @__sd_eh_personality(i32, i32, i64, ptr, ptr)
74 declare void @__sd_eh_throw(ptr nonnull) #0
76 ; Function Attrs: nounwind readnone
77 declare i32 @llvm.eh.typeid.for(ptr) #1
79 attributes #0 = { noreturn }
80 attributes #1 = { nounwind readnone }