1; RUN: llc -mtriple=armv7-none-linux-gnueabi < %s | FileCheck %s
2
3@_ZTVN10__cxxabiv117__class_type_infoE = external global i8*
4@_ZTS3Foo = linkonce_odr constant [5 x i8] c"3Foo\00"
5@_ZTI3Foo = linkonce_odr unnamed_addr constant { i8*, i8* } { i8* bitcast (i8** getelementptr inbounds (i8** @_ZTVN10__cxxabiv117__class_type_infoE, i32 2) to i8*), i8* getelementptr inbounds ([5 x i8]* @_ZTS3Foo, i32 0, i32 0) }
6
7define i32 @main() {
8entry:
9  invoke void @_Z3foov()
10          to label %return unwind label %lpad
11
12lpad:                                             ; preds = %entry
13  %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
14          catch i8* bitcast ({ i8*, i8* }* @_ZTI3Foo to i8*)
15  %1 = extractvalue { i8*, i32 } %0, 1
16  %2 = tail call i32 @llvm.eh.typeid.for(i8* bitcast ({ i8*, i8* }* @_ZTI3Foo to i8*)) 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 { i8*, i32 } %0, 0
24  %4 = tail call i8* @__cxa_begin_catch(i8* %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 { i8*, i32 } %0
34}
35
36declare void @_Z3foov()
37
38declare i32 @__gxx_personality_v0(...)
39
40declare i32 @llvm.eh.typeid.for(i8*) nounwind readnone
41
42declare i8* @__cxa_begin_catch(i8*)
43
44declare void @__cxa_end_catch()
45