| # REQUIRES: webassembly | |
| # A data segment name applies to the segment its entry indexes, independent of | |
| # the entry's position in the name subsection. Entries naming the same segment | |
| # repeatedly must not write past the segments. | |
| # RUN: yaml2obj %s -o %t.wasm | |
| # RUN: %lldb %t.wasm -o "target modules dump sections" -o exit 2>&1 \ | |
| # RUN: | FileCheck %s | |
| # CHECK: [0x0000000000010000-0x0000000000010004) {{.*}}.wasm.first | |
| # CHECK: [0x0000000000020000-0x0000000000020004) {{.*}}.wasm.second | |
| --- !WASM | |
| FileHeader: | |
| Version: 0x1 | |
| Sections: | |
| - Type: MEMORY | |
| Memories: | |
| - Minimum: 0x4 | |
| - Type: DATA | |
| Segments: | |
| - SectionOffset: 6 | |
| InitFlags: 0 | |
| Offset: | |
| Opcode: I32_CONST | |
| Value: 65536 | |
| Content: 'DEADBEEF' | |
| - SectionOffset: 16 | |
| InitFlags: 0 | |
| Offset: | |
| Opcode: I32_CONST | |
| Value: 131072 | |
| Content: 'CAFEF00D' | |
| - Type: CUSTOM | |
| Name: name | |
| DataSegmentNames: | |
| - Index: 1 | |
| Name: second | |
| - Index: 0 | |
| Name: first | |
| - Index: 0 | |
| Name: first | |
| - Index: 0 | |
| Name: first | |
| - Index: 0 | |
| Name: first | |
| ... |