blob: 647f6da984980eb290a4f996caf6657bbf6602f9 [file] [log] [blame]
## Test global symbal table of big archive.
# RUN: rm -rf %t && mkdir %t && cd %t
# RUN: yaml2obj --docnum=1 -DFLAG=0x1DF %s -o t32_1.o
# RUN: yaml2obj --docnum=1 -DFLAG=0x1F7 %s -o t64_1.o
# RUN: yaml2obj --docnum=2 -DFLAG=0x1DF %s -o t32_2.o
# RUN: yaml2obj --docnum=2 -DFLAG=0x1F7 %s -o t64_2.o
# RUN: llvm-as -o 32.bc %p/Inputs/bitcode-sym32.ll
# RUN: llvm-as -o 64.bc %p/Inputs/bitcode-sym64.ll
## Test printing a big archive which only has 32-bits symbol names
# RUN: llvm-ar q t32.a t32_1.o t32_2.o 32.bc
# RUN: llvm-nm --print-armap t32.a 2>&1 | FileCheck --check-prefixes=GLOB32,NOGL64 %s
## Test printing a big archive which only has 64-bits symbol names
# RUN: llvm-ar q t64.a t64_1.o t64_2.o 64.bc
# RUN: llvm-nm --print-armap t64.a 2>&1 | FileCheck --check-prefixes=GLOB64,NOGL32 %s
## Test printing all 32-bits symbol names first and then 64-bits
# RUN: llvm-ar q t32_64_all.a t32_1.o t64_1.o t32_2.o t64_2.o 32.bc 64.bc
# RUN: llvm-nm --print-armap t32_64_all.a 2>&1 | FileCheck --check-prefixes=GLOB32,GLOB64 %s
#GLOB32: var_0x1DF in t32_1.o
#GLOB32-NEXT: array_0x1DF in t32_1.o
#GLOB32-NEXT: func_0x1DF in t32_2.o
#GLOB32-NEXT: bar_0x1DF in t32_2.o
#GLOB32-NEXT: foo32 in 32.bc
#GLOB32-NEXT: C32 in 32.bc
#NOGL32-NOT: var_0x1DF in t32_1.o
#NOGL32-NOT: array_0x1DF in t32_1.o
#NOGL32-NOT: func_0x1DF in t32_2.o
#NOGL32-NOT: bar_0x1DF in t32_2.o
#NOGL32-NOT: foo32 in 32.bc
#NOGL32-NOT: C32 in 32.bc
#GLOB64: var_0x1F7 in t64_1.o
#GLOB64-NEXT: array_0x1F7 in t64_1.o
#GLOB64-NEXT: func_0x1F7 in t64_2.o
#GLOB64-NEXT: bar_0x1F7 in t64_2.o
#GLOB64-NEXT: bar64 in 64.bc
#GLOB64-NEXT: C64 in 64.bc
#NOGL64-NOT: var_0x1F7 in t64_1.o
#NOGL64-NOT: array_0x1F7 in t64_1.o
#NOGL64-NOT: func_0x1F7 in t64_2.o
#NOGL64-NOT: bar_0x1F7 in t64_2.o
#NOGL64-NOT: bar64 in 64.bc
#NOGL64-NOT: C64 in 64.bc
--- !XCOFF
FileHeader:
MagicNumber: [[FLAG]]
Sections:
- Name: .data
Flags: [ STYP_DATA ]
Symbols:
- Name: var_[[FLAG]]
Section: .data
Type: 0x4000
StorageClass: C_EXT
AuxEntries:
- Type: AUX_CSECT
SymbolAlignmentAndType: 0x09
StorageMappingClass: XMC_RW
- Name: array_[[FLAG]]
Section: .data
Type: 0x4000
StorageClass: C_EXT
AuxEntries:
- Type: AUX_CSECT
SymbolAlignmentAndType: 0x09
StorageMappingClass: XMC_RW
--- !XCOFF
FileHeader:
MagicNumber: [[FLAG]]
Sections:
- Name: .text
Flags: [ STYP_DATA ]
Symbols:
- Name: func_[[FLAG]]
Section: .text
Type: 0x4000
StorageClass: C_EXT
AuxEntries:
- Type: AUX_CSECT
SymbolAlignmentAndType: 0x09
StorageMappingClass: XMC_PR
- Name: bar_[[FLAG]]
Section: .text
Type: 0x4000
StorageClass: C_EXT
AuxEntries:
- Type: AUX_CSECT
SymbolAlignmentAndType: 0x09
StorageMappingClass: XMC_PR