1 # RUN: llvm-mc -triple=wasm32-unknown-unknown -mattr=+unimplemented-simd128,+nontrapping-fptoint,+exception-handling < %s | FileCheck %s
2 # Check that it converts to .o without errors:
3 # RUN: llvm-mc -triple=wasm32-unknown-unknown -filetype=obj -mattr=+unimplemented-simd128,+nontrapping-fptoint,+exception-handling < %s | obj2yaml | FileCheck -check-prefix=BIN %s
5 # Minimal test for type indices in call_indirect.
8 .functype test0 (i32) -> (i32)
9 call_indirect
(f64
) -> (f64
)
14 # CHECK-NEXT: .functype test0 (i32) -> (i32)
15 # CHECK-NEXT: call_indirect (f64) -> (f64)
16 # CHECK-NEXT: end_function
19 # BIN-NEXT: FileHeader:
20 # BIN-NEXT: Version: 0x00000001
22 # BIN-NEXT: - Type: TYPE
23 # BIN-NEXT: Signatures:
24 # BIN-NEXT: - Index: 0
25 # BIN-NEXT: ParamTypes:
27 # BIN-NEXT: ReturnTypes:
29 # BIN-NEXT: - Index: 1
30 # BIN-NEXT: ParamTypes:
32 # BIN-NEXT: ReturnTypes:
34 # BIN-NEXT: - Type: IMPORT
36 # BIN-NEXT: - Module: env
37 # BIN-NEXT: Field: __linear_memory
38 # BIN-NEXT: Kind: MEMORY
40 # BIN-NEXT: Initial: 0x00000000
41 # BIN-NEXT: - Module: env
42 # BIN-NEXT: Field: __indirect_function_table
43 # BIN-NEXT: Kind: TABLE
45 # BIN-NEXT: ElemType: FUNCREF
47 # BIN-NEXT: Initial: 0x00000000
48 # BIN-NEXT: - Type: FUNCTION
49 # BIN-NEXT: FunctionTypes: [ 0 ]
50 # BIN-NEXT: - Type: CODE
51 # BIN-NEXT: Relocations:
52 # BIN-NEXT: - Type: R_WASM_TYPE_INDEX_LEB
54 # BIN-NEXT: Offset: 0x00000004
55 # BIN-NEXT: Functions:
56 # BIN-NEXT: - Index: 0
57 # BIN-NEXT: Locals: []
58 # BIN-NEXT: Body: 118180808000000B
59 # BIN-NEXT: - Type: CUSTOM
60 # BIN-NEXT: Name: linking
61 # BIN-NEXT: Version: 2
62 # BIN-NEXT: SymbolTable:
63 # BIN-NEXT: - Index: 0
64 # BIN-NEXT: Kind: FUNCTION
65 # BIN-NEXT: Name: test0
66 # BIN-NEXT: Flags: [ BINDING_LOCAL ]
67 # BIN-NEXT: Function: 0