1# RUN: yaml2obj %s -o %t.o
2# RUN: llc -filetype=obj  %S/Inputs/custom.ll -o %t2.o
3# RUN: wasm-ld --no-entry -o - %t2.o %t.o | obj2yaml | FileCheck %s
4# RUN: wasm-ld -r --no-entry -o - %t2.o %t.o | obj2yaml | FileCheck %s -check-prefix=RELOC
5
6--- !WASM
7FileHeader:
8  Version:         0x00000001
9Sections:
10  - Type:            CUSTOM
11    Name:            green
12    Payload:         'AA0000000000000000'
13    Relocations:
14      - Type:            R_WASM_SECTION_OFFSET_I32
15        Index:           0
16        Offset:          0x00000001
17      - Type:            R_WASM_SECTION_OFFSET_I32
18        Index:           1
19        Offset:          0x00000005
20  - Type:            CUSTOM
21    Name:            red
22    Payload:         'BB0000000000000000'
23  - Type:            CUSTOM
24    Name:            linking
25    Version:         2
26    SymbolTable:
27      - Index:           0
28        Kind:            SECTION
29        Section:         0
30        Flags:           [ BINDING_LOCAL ]
31      - Index:           1
32        Kind:            SECTION
33        Section:         1
34        Flags:           [ BINDING_LOCAL ]
35...
36
37# CHECK:        Name:            green
38# CHECK-NEXT:   Payload:         626172717578AA0600000003000000
39# CHECK:        Name:            red
40# CHECK-NEXT:   Payload:         666F6FBB0000000000000000
41
42# RELOC:        Relocations:
43# RELOC-NEXT:       - Type:            R_WASM_SECTION_OFFSET_I32
44# RELOC-NEXT:         Index:           0
45# RELOC-NEXT:         Offset:          0x7
46# RELOC-NEXT:         Addend:          6
47# RELOC-NEXT:       - Type:            R_WASM_SECTION_OFFSET_I32
48# RELOC-NEXT:         Index:           1
49# RELOC-NEXT:         Offset:          0xB
50# RELOC-NEXT:         Addend:          3
51# RELOC-NEXT:    Name:            green
52#
53# RELOC:        SymbolTable:
54# RELOC-NEXT:     - Index:           0
55# RELOC-NEXT:       Kind:            SECTION
56# RELOC-NEXT:       Flags:           [ BINDING_LOCAL ]
57# RELOC-NEXT:       Section:         2
58# RELOC-NEXT:     - Index:           1
59# RELOC-NEXT:       Kind:            SECTION
60# RELOC-NEXT:       Flags:           [ BINDING_LOCAL ]
61# RELOC-NEXT:       Section:         3
62