brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.2 KiB · 91383d0 Raw
88 lines · plain
1# RUN: rm -f %t.a2# RUN: rm -rf %t3# RUN: mkdir -p %t4# RUN: yaml2obj --docnum=1 %s -o %t/1.o5# RUN: yaml2obj --docnum=2 %s -o %t/2.o6# RUN: yaml2obj --docnum=3 %s -o %t/3.o7# RUN: llvm-ar rcT %t.a %t/1.o %t/2.o %t/3.o8 9# Test that basic dumping works for all members.10# RUN: llvm-readobj --all %t.a | FileCheck %s --check-prefixes=LLVM,COFF11# RUN: llvm-readelf --all %t.a | FileCheck %s --check-prefixes=GNU,COFF12 13# LLVM: File: {{.*}}1.o14# LLVM: Format: elf64-x86-6415# LLVM: ElfHeader {16# LLVM:   SectionHeaderCount: 317# LLVM: Sections [18# LLVM: Relocations [19# LLVM: Symbols [20 21# GNU: ELF Header:22# GNU:   Number of section headers: 323# GNU: Section Headers:24 25# LLVM: File: {{.*}}2.o26# LLVM: Format: elf32-i38627# LLVM: ElfHeader {28# LLVM:   SectionHeaderCount: 429# LLVM: Sections [30# LLVM: Relocations [31# LLVM: Symbols [32 33# GNU: ELF Header:34# GNU:   Number of section headers: 435# GNU: Section Headers:36 37# LLVM: File: {{.*}}3.o38# LLVM: Format: COFF-ARM39# COFF: ImageFileHeader {40# COFF: Sections [41# COFF: Relocations [42# COFF: Symbols [43 44# Overwrite one of the members with a member of a different size to show that45# the size field in the member header is not relevant.46# RUN: rm -f %t/2.o47# RUN: cp %t/1.o %t/2.o48# RUN: llvm-readobj --file-headers %t.a | FileCheck %s --check-prefix=RESIZED49 50# RESIZED: File: {{.*}}1.o51# RESIZED: Format: elf64-x86-6452# RESIZED: File: {{.*}}2.o53# RESIZED: Format: elf64-x86-6454 55# Remove the second member and show that the first can still be dumped, but that the last isn't.56# RUN: rm %t/2.o57# RUN: not llvm-readobj --file-headers %t.a 2> %t.err | FileCheck %s --check-prefix=MISSING58# RUN: FileCheck -DMSG=%errc_ENOENT %s --check-prefix=ERR --input-file=%t.err59 60# MISSING:     File: {{.*}}1.o61# MISSING:     Format: elf64-x86-6462# MISSING-NOT: File: {{.*}}3.o63# ERR: error: '{{.*}}.a': '{{.*}}2.o': [[MSG]]64 65--- !ELF66FileHeader:67  Class:   ELFCLASS6468  Data:    ELFDATA2LSB69  Type:    ET_REL70  Machine: EM_X86_6471 72--- !ELF73FileHeader:74  Class:   ELFCLASS3275  Data:    ELFDATA2LSB76  Type:    ET_REL77  Machine: EM_38678Sections:79  - Name: .foo80    Type: SHT_PROGBITS81 82--- !COFF83header:84  Machine:         IMAGE_FILE_MACHINE_ARMNT85  Characteristics: [  ]86sections: []87symbols: []88