1 ; RUN: llc < %s -mtriple x86_64-apple-macosx10.8.0 -disable-cfi | FileCheck -check-prefix=MACHO %s
2 ; RUN: llc < %s -mtriple x86_64-unknown-linux -disable-cfi | FileCheck -check-prefix=ELF %s
4 ; Make sure we don't generate a compact unwind for ELF.
6 ; MACHO-LABEL: _Z3barv:
7 ; MACHO: __compact_unwind
10 ; ELF-NOT: __compact_unwind
12 @_ZTIi = external constant i8*
14 define void @_Z3barv() uwtable {
16 invoke void @_Z3foov()
17 to label %try.cont unwind label %lpad
19 lpad: ; preds = %entry
20 %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
21 catch i8* bitcast (i8** @_ZTIi to i8*)
22 %1 = extractvalue { i8*, i32 } %0, 1
23 %2 = tail call i32 @llvm.eh.typeid.for(i8* bitcast (i8** @_ZTIi to i8*))
24 %matches = icmp eq i32 %1, %2
25 br i1 %matches, label %catch, label %eh.resume
27 catch: ; preds = %lpad
28 %3 = extractvalue { i8*, i32 } %0, 0
29 %4 = tail call i8* @__cxa_begin_catch(i8* %3)
30 tail call void @__cxa_end_catch()
33 try.cont: ; preds = %entry, %catch
36 eh.resume: ; preds = %lpad
37 resume { i8*, i32 } %0
40 declare void @_Z3foov()
42 declare i32 @__gxx_personality_v0(...)
44 declare i32 @llvm.eh.typeid.for(i8*)
46 declare i8* @__cxa_begin_catch(i8*)
48 declare void @__cxa_end_catch()