1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00
llvm-mirror/test/CodeGen/AArch64/windows-SEH-support.ll
Saleem Abdulrasool dc3c5dd6f9 AArch64: support funclets in fastcall and swift_call
Functions annotated with `__fastcall` or `__attribute__((__fastcall__))`
or `__attribute__((__swiftcall__))` may contain SEH handlers even on
Win64.  This matches the behaviour of cl which allows for
`__try`/`__except` inside a `__fastcall` function.  This was detected
while trying to self-host clang on Windows ARM64.

llvm-svn: 348337
2018-12-05 07:09:20 +00:00

37 lines
1.3 KiB
LLVM

; RUN: llc -mtriple aarch64-unknown-windows-msvc -filetype asm -o /dev/null %s
declare dllimport void @f() local_unnamed_addr
declare dso_local i32 @__C_specific_handler(...)
define hidden swiftcc void @g() unnamed_addr personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*) {
entry:
invoke void @f() to label %__try.cont unwind label %catch.dispatch
catch.dispatch: ; preds = %entry
%0 = catchswitch within none [label %__except] unwind to caller
__except:
%1 = catchpad within %0 [i8* null] ; preds = %catch.dispatch
catchret from %1 to label %__try.cont
__try.cont: ; preds = %__except, %entry
ret void
}
define hidden fastcc void @h() unnamed_addr personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*) {
entry:
invoke void @f() to label %__try.cont unwind label %catch.dispatch
catch.dispatch: ; preds = %entry
%0 = catchswitch within none [label %__except] unwind to caller
__except: ; preds = %catch.dispatch
%1 = catchpad within %0 [i8* null]
catchret from %1 to label %__try.cont
__try.cont: ; preds = %__except, %entry
ret void
}