2021-01-02 01:27:09 +08:00
|
|
|
; RUN: llc -simplifycfg-require-and-preserve-domtree=1 < %s -mtriple=i686-pc-linux-gnu -o - | FileCheck %s --check-prefix=LIN
|
|
|
|
; RUN: llc -simplifycfg-require-and-preserve-domtree=1 < %s -mtriple=i386-pc-mingw32 -o - | FileCheck %s --check-prefix=WIN
|
|
|
|
; RUN: llc -simplifycfg-require-and-preserve-domtree=1 < %s -mtriple=i686-pc-windows-gnu -o - | FileCheck %s --check-prefix=WIN
|
|
|
|
; RUN: llc -simplifycfg-require-and-preserve-domtree=1 < %s -mtriple=x86_64-pc-windows-gnu -o - | FileCheck %s --check-prefix=WIN64
|
2014-04-01 01:34:15 +08:00
|
|
|
|
|
|
|
; LIN: .cfi_personality 0, __gnat_eh_personality
|
|
|
|
; LIN: .cfi_lsda 0, .Lexception0
|
|
|
|
; WIN: .cfi_personality 0, ___gnat_eh_personality
|
|
|
|
; WIN: .cfi_lsda 0, Lexception0
|
2014-06-25 20:41:52 +08:00
|
|
|
; WIN64: .seh_handler __gnat_eh_personality
|
|
|
|
; WIN64: .seh_handlerdata
|
2007-05-06 04:22:08 +08:00
|
|
|
|
2011-06-18 14:05:24 +08:00
|
|
|
@error = external global i8
|
2007-05-06 04:22:08 +08:00
|
|
|
|
2015-06-18 04:52:32 +08:00
|
|
|
define void @_ada_x() personality i8* bitcast (i32 (...)* @__gnat_eh_personality to i8*) {
|
2007-05-06 04:22:08 +08:00
|
|
|
entry:
|
2011-06-18 14:05:24 +08:00
|
|
|
invoke void @raise()
|
|
|
|
to label %eh_then unwind label %unwind
|
|
|
|
|
2014-06-25 20:41:52 +08:00
|
|
|
unwind: ; preds = %entry
|
2015-06-18 04:52:32 +08:00
|
|
|
%eh_ptr = landingpad { i8*, i32 }
|
2011-11-08 08:17:28 +08:00
|
|
|
catch i8* @error
|
|
|
|
%eh_select = extractvalue { i8*, i32 } %eh_ptr, 1
|
2011-06-18 14:05:24 +08:00
|
|
|
%eh_typeid = tail call i32 @llvm.eh.typeid.for(i8* @error)
|
|
|
|
%tmp2 = icmp eq i32 %eh_select, %eh_typeid
|
|
|
|
br i1 %tmp2, label %eh_then, label %Unwind
|
|
|
|
|
|
|
|
eh_then: ; preds = %unwind, %entry
|
|
|
|
ret void
|
|
|
|
|
|
|
|
Unwind: ; preds = %unwind
|
2011-11-08 08:17:28 +08:00
|
|
|
resume { i8*, i32 } %eh_ptr
|
2007-05-06 04:22:08 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
declare void @raise()
|
|
|
|
|
2011-06-18 14:05:24 +08:00
|
|
|
declare i32 @llvm.eh.typeid.for(i8*) nounwind
|
2007-05-06 04:22:08 +08:00
|
|
|
|
|
|
|
declare i32 @__gnat_eh_personality(...)
|
|
|
|
|
|
|
|
declare i32 @_Unwind_Resume(...)
|