brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · 670f724 Raw
26 lines · plain
1## This test ensures llvm-size emits a helpful error message when dumping a symbol table2## whose sh_size isn't a multiple of the symbol size (sh_size % sizeof(Elf_Sym) != 0).3 4## a) Test sysv output format.5# RUN: yaml2obj -DBITS=32 -DSIZE=33 -DDYNSIZE=32 %s -o %t.32-bit.o6# RUN: not llvm-size --common --format=sysv %t.32-bit.o 2>&1 | FileCheck -DSIZE=33 -DSYMSIZE=16 %s7# RUN: yaml2obj -DBITS=64 -DSIZE=49 -DDYNSIZE=48 %s -o %t.64-bit.o8# RUN: not llvm-size --common --format=sysv %t.64-bit.o 2>&1 | FileCheck -DSIZE=49 -DSYMSIZE=24 %s9 10## b) Test berkeley output format.11# RUN: not llvm-size --common --format=berkeley %t.32-bit.o 2>&1 | FileCheck -DSIZE=33 -DSYMSIZE=16 %s12# RUN: not llvm-size --common --format=berkeley %t.64-bit.o 2>&1 | FileCheck -DSIZE=49 -DSYMSIZE=24 %s13 14# CHECK: error: {{.*}} section [index 1] has an invalid sh_size ([[SIZE]]) which is not a multiple of its sh_entsize ([[SYMSIZE]])15 16--- !ELF17FileHeader:18  Class:   ELFCLASS[[BITS]]19  Data:    ELFDATA2LSB20  Type:    ET_DYN21  Machine: EM_X86_6422Sections:23  - Name:    .symtab24    Type:    SHT_SYMTAB25    Size:    [[SIZE]]26