[MIParser] Set RegClassOrRegBank during instruction parsing
[llvm-complete.git] / test / MC / WebAssembly / type-index.s
blob9c77434589f58eccb5118547e427da0831e2de3b
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.
7 test0:
8 .functype test0 (i32) -> (i32)
9 call_indirect (f64) -> (f64)
10 end_function
12 # CHECK: .text
13 # CHECK-LABEL: test0:
14 # CHECK-NEXT: .functype test0 (i32) -> (i32)
15 # CHECK-NEXT: call_indirect (f64) -> (f64)
16 # CHECK-NEXT: end_function
18 # BIN: --- !WASM
19 # BIN-NEXT: FileHeader:
20 # BIN-NEXT: Version: 0x00000001
21 # BIN-NEXT: Sections:
22 # BIN-NEXT: - Type: TYPE
23 # BIN-NEXT: Signatures:
24 # BIN-NEXT: - Index: 0
25 # BIN-NEXT: ParamTypes:
26 # BIN-NEXT: - I32
27 # BIN-NEXT: ReturnTypes:
28 # BIN-NEXT: - I32
29 # BIN-NEXT: - Index: 1
30 # BIN-NEXT: ParamTypes:
31 # BIN-NEXT: - F64
32 # BIN-NEXT: ReturnTypes:
33 # BIN-NEXT: - F64
34 # BIN-NEXT: - Type: IMPORT
35 # BIN-NEXT: Imports:
36 # BIN-NEXT: - Module: env
37 # BIN-NEXT: Field: __linear_memory
38 # BIN-NEXT: Kind: MEMORY
39 # BIN-NEXT: Memory:
40 # BIN-NEXT: Initial: 0x00000000
41 # BIN-NEXT: - Module: env
42 # BIN-NEXT: Field: __indirect_function_table
43 # BIN-NEXT: Kind: TABLE
44 # BIN-NEXT: Table:
45 # BIN-NEXT: ElemType: FUNCREF
46 # BIN-NEXT: Limits:
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
53 # BIN-NEXT: Index: 1
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
68 # BIN-NEXT: ...