1 ; RUN: llc -filetype=obj -wasm-enable-eh -exception-model=wasm -mattr=+exception-handling %s -o - | obj2yaml | FileCheck %s
2 ; RUN: llc -filetype=obj -wasm-enable-eh -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, ptr)
8 define i32 @test_throw0(ptr %p) {
9 call void @llvm.wasm.throw(i32 0, ptr %p)
13 define i32 @test_throw1(ptr %p) {
14 call void @llvm.wasm.throw(i32 0, ptr %p)
19 ; CHECK-NEXT: - Type: TYPE
20 ; CHECK-NEXT: Signatures:
21 ; CHECK-NEXT: - Index: 0
22 ; CHECK-NEXT: ParamTypes:
24 ; CHECK-NEXT: ReturnTypes:
26 ; CHECK-NEXT: - Index: 1
27 ; CHECK-NEXT: ParamTypes:
29 ; CHECK-NEXT: ReturnTypes: []
32 ; CHECK-NEXT: TagTypes: [ 1 ]
34 ; CHECK-NEXT: - Type: CODE
35 ; CHECK-NEXT: Relocations:
36 ; CHECK-NEXT: - Type: R_WASM_TAG_INDEX_LEB
37 ; CHECK-NEXT: Index: 1
38 ; CHECK-NEXT: Offset: 0x6
39 ; CHECK-NEXT: - Type: R_WASM_TAG_INDEX_LEB
40 ; CHECK-NEXT: Index: 1
41 ; CHECK-NEXT: Offset: 0x11
43 ; CHECK: - Type: CUSTOM
44 ; CHECK-NEXT: Name: linking
45 ; CHECK-NEXT: Version: 2
46 ; CHECK-NEXT: SymbolTable:
49 ; CHECK-NEXT: Kind: TAG
50 ; CHECK-NEXT: Name: __cpp_exception
51 ; CHECK-NEXT: Flags: [ BINDING_WEAK ]
54 ; SEC: Type: TAG (0xD)
56 ; SEC-NEXT: Offset: 63