1 ; RUN: llc -filetype=obj -exception-model=wasm -mattr=+exception-handling %s -o - | obj2yaml | FileCheck %s
2 ; RUN: llc -filetype=obj -exception-model=wasm -mattr=+exception-handling %s -o - | llvm-readobj -S | FileCheck -check-prefix=SEC %s
4 target triple = "wasm32-unknown-unknown"
6 declare void @llvm.wasm.throw(i32, i8*)
8 define i32 @test_throw0(i8* %p) {
9 call void @llvm.wasm.throw(i32 0, i8* %p)
13 define i32 @test_throw1(i8* %p) {
14 call void @llvm.wasm.throw(i32 0, i8* %p)
19 ; CHECK-NEXT: - Type: TYPE
20 ; CHECK-NEXT: Signatures:
21 ; CHECK-NEXT: - Index: 0
22 ; CHECK-NEXT: ReturnType: I32
23 ; CHECK-NEXT: ParamTypes:
25 ; CHECK-NEXT: - Index: 1
26 ; CHECK-NEXT: ReturnType: NORESULT
27 ; CHECK-NEXT: ParamTypes:
30 ; CHECK: - Type: EVENT
32 ; CHECK-NEXT: - Index: 0
33 ; CHECK-NEXT: Attribute: 0
34 ; CHECK-NEXT: SigIndex: 1
36 ; CHECK-NEXT: - Type: CODE
37 ; CHECK-NEXT: Relocations:
38 ; CHECK-NEXT: - Type: R_WASM_EVENT_INDEX_LEB
39 ; CHECK-NEXT: Index: 1
40 ; CHECK-NEXT: Offset: 0x00000006
41 ; CHECK-NEXT: - Type: R_WASM_EVENT_INDEX_LEB
42 ; CHECK-NEXT: Index: 1
43 ; CHECK-NEXT: Offset: 0x00000011
45 ; CHECK: - Type: CUSTOM
46 ; CHECK-NEXT: Name: linking
47 ; CHECK-NEXT: Version: 2
48 ; CHECK-NEXT: SymbolTable:
51 ; CHECK-NEXT: Kind: EVENT
52 ; CHECK-NEXT: Name: __cpp_exception
53 ; CHECK-NEXT: Flags: [ BINDING_WEAK ]
54 ; CHECK-NEXT: Event: 0
56 ; SEC: Type: EVENT (0xD)
58 ; SEC-NEXT: Offset: 97