xref: /llvm-project/llvm/test/CodeGen/ARM/arm-ttype-target2.ll (revision bed1c7f061aa12417aa081e334afdba45767b938)
1; RUN: llc -mtriple=armv7-none-linux-gnueabi -simplifycfg-require-and-preserve-domtree=1 < %s | FileCheck %s
2
3@_ZTVN10__cxxabiv117__class_type_infoE = external global ptr
4@_ZTS3Foo = linkonce_odr constant [5 x i8] c"3Foo\00"
5@_ZTI3Foo = linkonce_odr unnamed_addr constant { ptr, ptr } { ptr getelementptr inbounds (ptr, ptr @_ZTVN10__cxxabiv117__class_type_infoE, i32 2), ptr @_ZTS3Foo }
6
7define i32 @main() personality ptr @__gxx_personality_v0 {
8entry:
9  invoke void @_Z3foov()
10          to label %return unwind label %lpad
11
12lpad:                                             ; preds = %entry
13  %0 = landingpad { ptr, i32 }
14          catch ptr @_ZTI3Foo
15  %1 = extractvalue { ptr, i32 } %0, 1
16  %2 = tail call i32 @llvm.eh.typeid.for(ptr @_ZTI3Foo) nounwind
17; CHECK: _ZTI3Foo(target2)
18
19  %matches = icmp eq i32 %1, %2
20  br i1 %matches, label %catch, label %eh.resume
21
22catch:                                            ; preds = %lpad
23  %3 = extractvalue { ptr, i32 } %0, 0
24  %4 = tail call ptr @__cxa_begin_catch(ptr %3) nounwind
25  tail call void @__cxa_end_catch()
26  br label %return
27
28return:                                           ; preds = %entry, %catch
29  %retval.0 = phi i32 [ 1, %catch ], [ 0, %entry ]
30  ret i32 %retval.0
31
32eh.resume:                                        ; preds = %lpad
33  resume { ptr, i32 } %0
34}
35
36declare void @_Z3foov()
37
38declare i32 @__gxx_personality_v0(...)
39
40declare i32 @llvm.eh.typeid.for(ptr) nounwind readnone
41
42declare ptr @__cxa_begin_catch(ptr)
43
44declare void @__cxa_end_catch()
45