[llvm-readobj][test] Pre-commit an empty symbol name test for D155353
authorFangrui Song <i@maskray.me>
Thu, 20 Jul 2023 07:39:01 +0000 (00:39 -0700)
committerFangrui Song <i@maskray.me>
Thu, 20 Jul 2023 07:39:01 +0000 (00:39 -0700)
llvm/test/tools/llvm-readobj/ELF/reloc-zero-name-or-value.test

index 30743cf..a44ff3d 100644 (file)
@@ -4,6 +4,7 @@
 
 # RUN: yaml2obj %s -o %t
 # RUN: llvm-readelf --relocations --dyn-relocations %t 2>&1 | FileCheck %s -DFILE=%t
+# RUN: llvm-readobj --relocations %t 2>&1 | FileCheck %s -DFILE=%t --check-prefix=LLVM
 
 # CHECK:      Relocation section '.rela.text' at offset {{.*}} contains 5 entries:
 # CHECK-NEXT:     Offset             Info             Type               Symbol's Value  Symbol's Name + Addend
 # CHECK-NEXT: 0000000000000000  0000000300000000 R_X86_64_NONE          0000000000000000 678
 # CHECK-NEXT: 0000000000000000  0000000400000000 R_X86_64_NONE          0000000000000000 2
 
+# LLVM:      Relocations [
+# LLVM-NEXT:   Section (2) .rela.text {
+# LLVM-NEXT:     0x0 R_X86_64_NONE - 0x1
+# LLVM-NEXT:     0x0 R_X86_64_NONE sym 0x1
+# LLVM-NEXT:     0x0 R_X86_64_NONE - 0x456
+# LLVM-NEXT: warning: '[[FILE]]': unable to get section index for symbol with st_shndx = 0x0 (SHN_UNDEF)
+# LLVM-NEXT:     0x0 R_X86_64_NONE <?> 0x678
+# LLVM-NEXT:     0x0 R_X86_64_NONE - 0x2
+# LLVM-NEXT:   }
+# LLVM-NEXT:   Section (4) .rela.dyn {
+# LLVM-NEXT:     0x0 R_X86_64_NONE - 0x1
+# LLVM-NEXT:     0x0 R_X86_64_NONE sym 0x1
+# LLVM-NEXT:     0x0 R_X86_64_NONE - 0x456
+# LLVM-NEXT:     0x0 R_X86_64_NONE <?> 0x678
+# LLVM-NEXT:     0x0 R_X86_64_NONE - 0x2
+# LLVM-NEXT:   }
+# LLVM-NEXT: ]
+
 --- !ELF
 FileHeader:
   Class:   ELFCLASS64