1 # RUN: llvm-mc -triple=wasm32-unknown-unknown -mattr=+reference-types < %s | FileCheck --check-prefix=CHECK %s
2 # RUN: llvm-mc -triple=wasm32-unknown-unknown -mattr=+reference-types -filetype=obj < %s | obj2yaml | FileCheck -check-prefix=BIN %s
5 .functype test0 () -> ()
9 call_indirect empty_fref_table
, (i32
, f64
) -> ()
12 .tabletype empty_fref_table, funcref
18 # CHECK-NEXT: .functype test0 () -> ()
19 # CHECK-NEXT: i32.const 42
20 # CHECK-NEXT: f64.const 0x1.4p1
21 # CHECK-NEXT: i32.const 0
22 # CHECK-NEXT: call_indirect empty_fref_table, (i32, f64) -> ()
23 # CHECK-NEXT: end_function
25 # CHECK: .tabletype empty_fref_table, funcref
26 # CHECK: empty_fref_table:
29 # BIN-NEXT: FileHeader:
30 # BIN-NEXT: Version: 0x1
32 # BIN-NEXT: - Type: TYPE
33 # BIN-NEXT: Signatures:
34 # BIN-NEXT: - Index: 0
35 # BIN-NEXT: ParamTypes: []
36 # BIN-NEXT: ReturnTypes: []
37 # BIN-NEXT: - Index: 1
38 # BIN-NEXT: ParamTypes:
41 # BIN-NEXT: ReturnTypes: []
42 # BIN-NEXT: - Type: IMPORT
44 # BIN-NEXT: - Module: env
45 # BIN-NEXT: Field: __linear_memory
46 # BIN-NEXT: Kind: MEMORY
48 # BIN-NEXT: Minimum: 0x0
49 # BIN-NEXT: - Type: FUNCTION
50 # BIN-NEXT: FunctionTypes: [ 0 ]
51 # BIN-NEXT: - Type: TABLE
53 # BIN-NEXT: - Index: 0
54 # BIN-NEXT: ElemType: FUNCREF
56 # BIN-NEXT: Minimum: 0x0
57 # BIN-NEXT: - Type: CODE
58 # BIN-NEXT: Relocations:
59 # BIN-NEXT: - Type: R_WASM_TYPE_INDEX_LEB
61 # BIN-NEXT: Offset: 0x11
62 # BIN-NEXT: - Type: R_WASM_TABLE_NUMBER_LEB
64 # BIN-NEXT: Offset: 0x16
65 # BIN-NEXT: Functions:
66 # BIN-NEXT: - Index: 0
67 # BIN-NEXT: Locals: []
68 # BIN-NEXT: Body: 412A440000000000000440410011818080800080808080000B
69 # BIN-NEXT: - Type: CUSTOM
70 # BIN-NEXT: Name: linking
71 # BIN-NEXT: Version: 2
72 # BIN-NEXT: SymbolTable:
73 # BIN-NEXT: - Index: 0
74 # BIN-NEXT: Kind: FUNCTION
75 # BIN-NEXT: Name: test0
76 # BIN-NEXT: Flags: [ BINDING_LOCAL ]
77 # BIN-NEXT: Function: 0
78 # BIN-NEXT: - Index: 1
79 # BIN-NEXT: Kind: TABLE
80 # BIN-NEXT: Name: empty_fref_table
81 # BIN-NEXT: Flags: [ BINDING_LOCAL ]