1 ## Check we do not fail to dump the section headers when
2 ## a .shstrtab section does not have a SHT_STRTAB type.
4 ## Check we report only one warning for the issue for each input object.
6 # RUN: yaml2obj %s -o %t1
7 # RUN: llvm-readobj -S %t1 2>&1 | FileCheck %s -DFILE=%t1 --implicit-check-not warning --check-prefix LLVM
8 # RUN: llvm-readelf -S %t1 2>&1 | FileCheck %s -DFILE=%t1 --implicit-check-not warning --check-prefix GNU
10 # LLVM: warning: '[[FILE]]': invalid sh_type for string table section [index 1]: expected SHT_STRTAB, but got SHT_PROGBITS
12 # LLVM: Name: .shstrtab
13 # LLVM: Type: SHT_PROGBITS
15 # GNU: Section Headers:
16 # GNU: [Nr] Name Type Address Off Size ES Flg Lk Inf Al
17 # GNU: warning: '[[FILE]]': invalid sh_type for string table section [index 1]: expected SHT_STRTAB, but got SHT_PROGBITS
18 # GNU: [ 1] .shstrtab PROGBITS 0000000000000000 000140 00001b 00 0 0 0
20 ## Test we report multiple identical warnings (one for each object) when dumping an archive.
24 # RUN: llvm-ar rc %t.a %t1 %t2 %t1
25 # RUN: llvm-readobj -S %t.a 2>&1 | FileCheck %s --implicit-check-not warning --check-prefix WARNINGS
26 # RUN: llvm-readelf -S %t.a 2>&1 | FileCheck %s --implicit-check-not warning --check-prefix WARNINGS
28 # WARNINGS: warning: '{{.*}}1': invalid sh_type for string table section [index 1]: expected SHT_STRTAB, but got SHT_PROGBITS
29 # WARNINGS: warning: '{{.*}}2': invalid sh_type for string table section [index 1]: expected SHT_STRTAB, but got SHT_PROGBITS
30 # WARNINGS: warning: '{{.*}}1': invalid sh_type for string table section [index 1]: expected SHT_STRTAB, but got SHT_PROGBITS
32 ## Test we report the warning for each input file specified on the command line.
34 # RUN: llvm-readobj -S %t1 %t2 %t1 2>&1 | FileCheck %s --implicit-check-not warning --check-prefix WARNINGS
35 # RUN: llvm-readelf -S %t1 %t2 %t1 2>&1 | FileCheck %s --implicit-check-not warning --check-prefix WARNINGS