[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / llvm / test / ObjectYAML / wasm / section_header_size.yaml
blobb632588d92e54d3195047143087752a0f35ab5bb
1 ## Test that obj2yaml output includes the section header size encoding length
2 ## only when the length isn't padded to 5 bytes.
3 # RUN: yaml2obj --docnum=1 %s | obj2yaml | FileCheck %s
5 --- !WASM
6 FileHeader:
7   Version:         0x1
8 Sections:
9   - Type:            TYPE
10     HeaderSecSizeEncodingLen:   3
11     Signatures:
12       - Index:           0
13         ParamTypes:
14           - I32
15           - I32
16         ReturnTypes:
17           - I32
18   - Type:            FUNCTION
19     HeaderSecSizeEncodingLen:  4
20     FunctionTypes:             [ 0 ]
21   - Type:            MEMORY
22     HeaderSecSizeEncodingLen:  1
23     Memories:
24       - Flags:           [ HAS_MAX ]
25         Minimum:         0x100
26         Maximum:         0x100
27   - Type:            EXPORT
28     HeaderSecSizeEncodingLen:  5
29     Exports:
30       - Name:            add
31         Kind:            FUNCTION
32         Index:           0
33   - Type:            CODE
34     HeaderSecSizeEncodingLen:  2
35     Functions:
36       - Index:           0
37         Locals:          []
38         Body:            200020016A0B
39 ...
40 # CHECK: --- !WASM
41 # CHECK-NEXT: FileHeader:
42 # CHECK-NEXT:   Version:         0x1
43 # CHECK-NEXT: Sections:
44 # CHECK-NEXT:   - Type:            TYPE
45 # CHECK-NEXT:     HeaderSecSizeEncodingLen:   3
46 # CHECK-NEXT:     Signatures:
47 # CHECK-NEXT:       - Index:           0
48 # CHECK-NEXT:         ParamTypes:
49 # CHECK-NEXT:           - I32
50 # CHECK-NEXT:           - I32
51 # CHECK-NEXT:         ReturnTypes:
52 # CHECK-NEXT:           - I32
53 # CHECK-NEXT:   - Type:            FUNCTION
54 # CHECK-NEXT:     HeaderSecSizeEncodingLen:  4
55 # CHECK-NEXT:     FunctionTypes:             [ 0 ]
56 # CHECK-NEXT:   - Type:            MEMORY
57 # CHECK-NEXT:     Memories:
58 # CHECK-NEXT:       - Flags:           [ HAS_MAX ]
59 # CHECK-NEXT:         Minimum:         0x100
60 # CHECK-NEXT:         Maximum:         0x100
61 # CHECK-NEXT:   - Type:            EXPORT
62 # CHECK-NEXT:     Exports:
63 # CHECK-NEXT:       - Name:            add
64 # CHECK-NEXT:         Kind:            FUNCTION
65 # CHECK-NEXT:         Index:           0
66 # CHECK-NEXT:   - Type:            CODE
67 # CHECK-NEXT:     HeaderSecSizeEncodingLen:  2
68 # CHECK-NEXT:     Functions:
69 # CHECK-NEXT:       - Index:           0
70 # CHECK-NEXT:         Locals:          []
71 # CHECK-NEXT:         Body:            200020016A0B
73 ## Test if we correctly error out if the provided section header size is less
74 ## than the size required.
75 # RUN: not yaml2obj --docnum=2 %s -o /dev/null 2>&1 | FileCheck %s --check-prefix=INVALID
76 # INVALID: yaml2obj: error: section header length can't be encoded in a LEB of size 0
78 --- !WASM
79 FileHeader:
80   Version:         0x1
81 Sections:
82   - Type:            TYPE
83     HeaderSecSizeEncodingLen:   0
84     Signatures:
85       - Index:           0
86         ParamTypes:
87           - I32
88           - I32
89         ReturnTypes:
90           - I32
91 ...