1## Test that the copied object has the same yaml conversion as the original.
2## The copied object is not bit-identical to the yaml2obj-generated
3## one, as yaml2obj uses 5-byte LEBs for section sizes (unlike objcopy/clang).
4# RUN: yaml2obj %s -o %t.o
5# RUN: llvm-objcopy %t.o %t2.o
6# RUN: obj2yaml %t.o > %t.yaml
7# RUN: obj2yaml %t2.o > %t2.yaml
8# RUN: diff %t.yaml %t2.yaml
9
10--- !WASM
11FileHeader:
12  Version: 0x00000001
13Sections:
14  - Type: TYPE
15    Signatures:
16      - Index: 0
17        ParamTypes:
18          - I32
19        ReturnTypes:
20          - F32
21      - Index: 1
22        ParamTypes:
23          - I32
24          - I64
25        ReturnTypes:     []
26  - Type: FUNCTION
27    FunctionTypes:
28      - 0
29      - 1
30  - Type: CODE
31    Relocations:
32      - Type:   R_WASM_TABLE_INDEX_SLEB
33        Index:  0
34        Offset: 0x00000002
35      - Type:   R_WASM_FUNCTION_INDEX_LEB
36        Index:  1
37        Offset: 0x0000002
38    Functions:
39      - Index:  0
40        Locals:
41         - Type:  I32
42           Count: 3
43        Body: 010101010B
44      - Index: 1
45        Locals:
46         - Type: I32
47           Count: 1
48        Body: 010101010B
49  - Type: CUSTOM
50    Name:    linking
51    Version: 2
52    SymbolTable:
53      - Index: 0
54        Kind:  FUNCTION
55        Name:  func1
56        Flags: [  ]
57        Function: 0
58      - Index: 1
59        Kind: FUNCTION
60        Name: func2
61        Flags: [  ]
62        Function: 1
63...
64