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
4
5# Minimal test for data sections.
6
7test0:
8    .functype   test0 () -> (i32)
9    i32.const .L.str
10.Ltestlabel:
11    end_function
12
13    .section	.rodata..L.str,"",@
14.L.str:
15    .int8	100
16    .size	.L.str, 1
17
18
19# CHECK:           .text
20# CHECK-LABEL: test0:
21# CHECK-NEXT:      .functype test0 () -> (i32)
22# CHECK-NEXT:      i32.const .L.str
23# CHECK-NEXT:  .Ltestlabel:
24# CHECK-NEXT:      end_function
25
26# CHECK:	    .section	.rodata..L.str,"",@
27# CHECK-NEXT:.L.str:
28# CHECK-NEXT:	.int8	100
29
30
31# BIN:      --- !WASM
32# BIN-NEXT: FileHeader:
33# BIN-NEXT:   Version:         0x00000001
34# BIN-NEXT: Sections:
35# BIN-NEXT:   - Type:            TYPE
36# BIN-NEXT:     Signatures:
37# BIN-NEXT:       - Index:           0
38# BIN-NEXT:         ParamTypes:      []
39# BIN-NEXT:         ReturnTypes:
40# BIN-NEXT:           - I32
41# BIN-NEXT:   - Type:            IMPORT
42# BIN-NEXT:     Imports:
43# BIN-NEXT:       - Module:          env
44# BIN-NEXT:         Field:           __linear_memory
45# BIN-NEXT:         Kind:            MEMORY
46# BIN-NEXT:         Memory:
47# BIN-NEXT:           Initial:         0x00000001
48# BIN-NEXT:       - Module:          env
49# BIN-NEXT:         Field:           __indirect_function_table
50# BIN-NEXT:         Kind:            TABLE
51# BIN-NEXT:         Table:
52# BIN-NEXT:           ElemType:        FUNCREF
53# BIN-NEXT:           Limits:
54# BIN-NEXT:             Initial:         0x00000000
55# BIN-NEXT:   - Type:            FUNCTION
56# BIN-NEXT:     FunctionTypes:   [ 0 ]
57# BIN-NEXT:   - Type:            DATACOUNT
58# BIN-NEXT:     Count:           1
59# BIN-NEXT:   - Type:            CODE
60# BIN-NEXT:     Relocations:
61# BIN-NEXT:       - Type:            R_WASM_MEMORY_ADDR_SLEB
62# BIN-NEXT:         Index:           1
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
69# BIN-NEXT:     Segments:
70# BIN-NEXT:       - SectionOffset:   6
71# BIN-NEXT:         InitFlags:       0
72# BIN-NEXT:         Offset:
73# BIN-NEXT:           Opcode:          I32_CONST
74# BIN-NEXT:           Value:           0
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
90# BIN-NEXT:         Size:            1
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:           [  ]
96# BIN-NEXT: ...
97