xref: /llvm-project/llvm/test/Object/Wasm/bad-data-symbol.yaml (revision 0d96422768908a8235f05a5d3b1d43ecc6038004)
1# RUN: yaml2obj %s | not llvm-objdump -s - 2>&1 | FileCheck %s
2
3# Check that data symbols must have and offset that is within the
4# bounds of the containing segment
5
6# CHECK: invalid data symbol offset: `foo` (offset: 42 segment size: 5)
7
8--- !WASM
9FileHeader:
10  Version:         0x00000001
11Sections:
12  - Type:            DATA
13    Segments:
14      - SectionOffset:   0
15        InitFlags:       0
16        Offset:
17          Opcode:          I32_CONST
18          Value:           0
19        Content:         '6401020304'
20  - Type:            CUSTOM
21    Name:            linking
22    Version:         2
23    SymbolTable:
24      - Index:           0
25        Kind:            DATA
26        Name:            foo
27        Flags:           [ ]
28        Segment:         0
29        Offset:          42
30        Size:            1
31...
32