xref: /llvm-project/llvm/test/CodeGen/WebAssembly/wasm-eh-invalid-personality.ll (revision 90073e8de3871776c4df1da78d19019990241f4d)
1; RUN: not --crash llc < %s -wasm-enable-eh -exception-model=wasm -mattr=+exception-handling 2>&1 | FileCheck %s
2
3target triple = "wasm32-unknown-unknown"
4
5; Tests if the compiler correctly errors out when a function having EH pads does
6; not have a correct Wasm personality function.
7
8define void @test() personality ptr @invalid_personality {
9; CHECK: LLVM ERROR: Function 'test' does not have a correct Wasm personality function '__gxx_wasm_personality_v0'
10entry:
11  invoke void @foo()
12          to label %try.cont unwind label %catch.dispatch
13
14catch.dispatch:                                   ; preds = %entry
15  %0 = catchswitch within none [label %catch.start] unwind to caller
16
17catch.start:                                      ; preds = %catch.dispatch
18  %1 = catchpad within %0 [ptr null]
19  catchret from %1 to label %try.cont
20
21try.cont:                                         ; preds = %catch, %entry
22  ret void
23}
24
25declare void @foo()
26declare i32 @invalid_personality(...)
27