Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / llvm / test / MC / WebAssembly / tag-section.ll
blobc40e132e36f04613a65f1e3d72b9a9429fc6a201
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)
10   ret i32 0
13 define i32 @test_throw1(ptr %p) {
14   call void @llvm.wasm.throw(i32 0, ptr %p)
15   ret i32 1
18 ; CHECK:      Sections:
19 ; CHECK-NEXT:   - Type:            TYPE
20 ; CHECK-NEXT:     Signatures:
21 ; CHECK-NEXT:       - Index:           0
22 ; CHECK-NEXT:         ParamTypes:
23 ; CHECK-NEXT:           - I32
24 ; CHECK-NEXT:         ReturnTypes:
25 ; CHECK-NEXT:           - I32
26 ; CHECK-NEXT:       - Index:           1
27 ; CHECK-NEXT:         ParamTypes:
28 ; CHECK-NEXT:           - I32
29 ; CHECK-NEXT:         ReturnTypes:      []
31 ; CHECK:        - Type:            TAG
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:
48 ; CHECK:            - Index:           1
49 ; CHECK-NEXT:         Kind:            TAG
50 ; CHECK-NEXT:         Name:            __cpp_exception
51 ; CHECK-NEXT:         Flags:           [ BINDING_WEAK ]
52 ; CHECK-NEXT:         Tag:             0
54 ; SEC:          Type: TAG (0xD)
55 ; SEC-NEXT:     Size: 3
56 ; SEC-NEXT:     Offset: 63