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 data sections.
8 .functype test0 () -> (i32)
13 .section .rodata..L.str,"",@
21 # CHECK-NEXT: .functype test0 () -> (i32)
22 # CHECK-NEXT: i32.const .L.str
23 # CHECK-NEXT: .Ltestlabel:
24 # CHECK-NEXT: end_function
26 # CHECK: .section .rodata..L.str,"",@
28 # CHECK-NEXT: .int8 100
32 # BIN-NEXT: FileHeader:
33 # BIN-NEXT: Version: 0x00000001
35 # BIN-NEXT: - Type: TYPE
36 # BIN-NEXT: Signatures:
37 # BIN-NEXT: - Index: 0
38 # BIN-NEXT: ParamTypes: []
39 # BIN-NEXT: ReturnTypes:
41 # BIN-NEXT: - Type: IMPORT
43 # BIN-NEXT: - Module: env
44 # BIN-NEXT: Field: __linear_memory
45 # BIN-NEXT: Kind: MEMORY
47 # BIN-NEXT: Initial: 0x00000001
48 # BIN-NEXT: - Module: env
49 # BIN-NEXT: Field: __indirect_function_table
50 # BIN-NEXT: Kind: TABLE
52 # BIN-NEXT: ElemType: FUNCREF
54 # BIN-NEXT: Initial: 0x00000000
55 # BIN-NEXT: - Type: FUNCTION
56 # BIN-NEXT: FunctionTypes: [ 0 ]
57 # BIN-NEXT: - Type: DATACOUNT
59 # BIN-NEXT: - Type: CODE
60 # BIN-NEXT: Relocations:
61 # BIN-NEXT: - Type: R_WASM_MEMORY_ADDR_SLEB
63 # BIN-NEXT: Offset: 0x00000004
64 # BIN-NEXT: Functions:
65 # BIN-NEXT: - Index: 0
66 # BIN-NEXT: Locals: []
67 # BIN-NEXT: Body: 4180808080000B
68 # BIN-NEXT: - Type: DATA
70 # BIN-NEXT: - SectionOffset: 6
71 # BIN-NEXT: InitFlags: 0
73 # BIN-NEXT: Opcode: I32_CONST
75 # BIN-NEXT: Content: '64'
76 # BIN-NEXT: - Type: CUSTOM
77 # BIN-NEXT: Name: linking
78 # BIN-NEXT: Version: 2
79 # BIN-NEXT: SymbolTable:
80 # BIN-NEXT: - Index: 0
81 # BIN-NEXT: Kind: FUNCTION
82 # BIN-NEXT: Name: test0
83 # BIN-NEXT: Flags: [ BINDING_LOCAL ]
84 # BIN-NEXT: Function: 0
85 # BIN-NEXT: - Index: 1
86 # BIN-NEXT: Kind: DATA
87 # BIN-NEXT: Name: .L.str
88 # BIN-NEXT: Flags: [ BINDING_LOCAL ]
89 # BIN-NEXT: Segment: 0
91 # BIN-NEXT: SegmentInfo:
92 # BIN-NEXT: - Index: 0
93 # BIN-NEXT: Name: .rodata..L.str
94 # BIN-NEXT: Alignment: 0
95 # BIN-NEXT: Flags: [ ]