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: ParamTypes:
24 ; CHECK-NEXT: ReturnTypes:
26 ; CHECK-NEXT: - Index: 1
27 ; CHECK-NEXT: ParamTypes:
29 ; CHECK-NEXT: ReturnTypes: []
31 ; CHECK: - Type: EVENT
33 ; CHECK-NEXT: - Index: 0
34 ; CHECK-NEXT: Attribute: 0
35 ; CHECK-NEXT: SigIndex: 1
37 ; CHECK-NEXT: - Type: CODE
38 ; CHECK-NEXT: Relocations:
39 ; CHECK-NEXT: - Type: R_WASM_EVENT_INDEX_LEB
40 ; CHECK-NEXT: Index: 1
41 ; CHECK-NEXT: Offset: 0x00000006
42 ; CHECK-NEXT: - Type: R_WASM_EVENT_INDEX_LEB
43 ; CHECK-NEXT: Index: 1
44 ; CHECK-NEXT: Offset: 0x00000011
46 ; CHECK: - Type: CUSTOM
47 ; CHECK-NEXT: Name: linking
48 ; CHECK-NEXT: Version: 2
49 ; CHECK-NEXT: SymbolTable:
52 ; CHECK-NEXT: Kind: EVENT
53 ; CHECK-NEXT: Name: __cpp_exception
54 ; CHECK-NEXT: Flags: [ BINDING_WEAK ]
55 ; CHECK-NEXT: Event: 0
57 ; SEC: Type: EVENT (0xD)
59 ; SEC-NEXT: Offset: 97