xref: /llvm-project/llvm/test/tools/llvm-nm/XCOFF/invalid-section-index.test (revision 6bf20aa59030175139853e48ccdfe31d718c1566)
1## Test the behavior of the symbol reference section.
2
3# RUN: yaml2obj  %s -o %t.o
4# RUN: llvm-nm %t.o 2>&1 | FileCheck %s -DFILE=%t.o
5
6# CHECK:      llvm-nm{{(\.exe)?}}: warning: [[FILE]]: for symbol with index 0: the section index (4) is invalid
7# CHECK-NEXT: 00000000 ? .text
8
9--- !XCOFF
10FileHeader:
11  MagicNumber: 0x1DF
12Sections:
13  - Name: .text
14Symbols:
15  - Name:               .text
16    Value:              0x0
17    SectionIndex:       4
18    Type:               0x0
19    StorageClass:       C_STAT
20    NumberOfAuxEntries: 1
21