1 ## Test malformed global symbal table of big archive.
3 # RUN: rm -rf %t && mkdir %t && cd %t
4 # RUN: yaml2obj -DFLAG=0x1DF %s -o t32.o
5 # RUN: yaml2obj -DFLAG=0x1F7 %s -o t64.o
6 # RUN: llvm-ar q t.a t32.o t64.o
13 ## Truncate the file to end before the 32-bit global symbol table header ends.
14 # RUN: %python -c "with open('t32_1.a', 'r+b') as input: input.truncate(856)"
15 ## Truncate the file to end before the 32-bit global symbol table ends.
16 # RUN: %python -c "with open('t32_2.a', 'r+b') as input: input.truncate(995)"
18 # RUN: not llvm-ar t t32_1.a 2>&1 | FileCheck -DFILE=t32_1.a --check-prefixes=HEADER32 %s
19 # RUN: not llvm-ar t t32_2.a 2>&1 | FileCheck -DFILE=t32_2.a --check-prefixes=CONTENT32 %s
21 # HEADER32: error: unable to load '[[FILE]]': truncated or malformed archive (32-bit global symbol table header at offset 0x34e and size 0x72 goes past the end of file)
22 # CONTENT32: error: unable to load '[[FILE]]': truncated or malformed archive (32-bit global symbol table content at offset 0x3c0 and size 0x2b goes past the end of file)
24 ## Truncate the file to end before the 64-bit global symbol table header ends.
25 # RUN: %python -c "with open('t64_1.a', 'r+b') as input: input.truncate(1014)"
26 ## Truncate the file to end before the 64-bit global symbol table ends.
27 # RUN: %python -c "with open('t64_2.a', 'r+b') as input: input.truncate(1096)"
29 # RUN: not llvm-ar t t64_1.a 2>&1 | FileCheck -DFILE=t64_1.a --check-prefixes=HEADER64 %s
30 # RUN: not llvm-ar t t64_2.a 2>&1 | FileCheck -DFILE=t64_2.a --check-prefixes=CONTENT64 %s
32 # HEADER64: error: unable to load '[[FILE]]': truncated or malformed archive (64-bit global symbol table header at offset 0x3ec and size 0x72 goes past the end of file)
33 # CONTENT64: error: unable to load '[[FILE]]': truncated or malformed archive (64-bit global symbol table header at offset 0x3ec and size 0x72 goes past the end of file)
42 - Name: export_protected_var_[[FLAG]]
48 SymbolAlignmentAndType: 0x09
49 StorageMappingClass: XMC_RW