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
10 HeaderSecSizeEncodingLen: 3
19 HeaderSecSizeEncodingLen: 4
22 HeaderSecSizeEncodingLen: 1
28 HeaderSecSizeEncodingLen: 5
34 HeaderSecSizeEncodingLen: 2
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:
51 # CHECK-NEXT: ReturnTypes:
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
83 HeaderSecSizeEncodingLen: 0