[lld] b96fc48 - [ELF][test] Fix CU address_size in some gdb-index tests

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 22 21:42:20 PST 2022


Author: Fangrui Song
Date: 2022-02-22T21:42:15-08:00
New Revision: b96fc4860f1615d8d1f686f1e400cc1f8e0d58ac

URL: https://github.com/llvm/llvm-project/commit/b96fc4860f1615d8d1f686f1e400cc1f8e0d58ac
DIFF: https://github.com/llvm/llvm-project/commit/b96fc4860f1615d8d1f686f1e400cc1f8e0d58ac.diff

LOG: [ELF][test] Fix CU address_size in some gdb-index tests

Revert 251640ab575634256de6d6fde5c5359fe21efe91 which fixed the wrong thing.

While here, add `2>&1 | count 0` to assert no warning from lib/DebugInfo/DWARF.

Added: 
    

Modified: 
    lld/test/ELF/comdat-discarded-gdb-index.s
    lld/test/ELF/gdb-index-multiple-cu-2.s
    lld/test/ELF/gdb-index-multiple-cu.s

Removed: 
    


################################################################################
diff  --git a/lld/test/ELF/comdat-discarded-gdb-index.s b/lld/test/ELF/comdat-discarded-gdb-index.s
index b9f36d8f6608..96905626d3c7 100644
--- a/lld/test/ELF/comdat-discarded-gdb-index.s
+++ b/lld/test/ELF/comdat-discarded-gdb-index.s
@@ -40,7 +40,7 @@ foo:
   .long   .Lcu_end0 - .Lcu_begin0 - 4
   .short  4              # DWARF version number
   .long   0              # Offset Into Abbrev. Section
-  .byte   4              # Address Size
+  .byte   8              # Address Size
 .Ldie0:
   .byte   1              # Abbrev [1] DW_TAG_compile_unit
   .quad   .Lfunc_begin0  # DW_AT_low_pc
@@ -48,7 +48,6 @@ foo:
   .byte   2              # Abbrev [2] DW_TAG_subprogram
   .asciz  "foo"          # DW_AT_name
   .byte   0
-  .byte   0
 .Lcu_end0:
 
 .section .debug_gnu_pubnames,"", at progbits

diff  --git a/lld/test/ELF/gdb-index-multiple-cu-2.s b/lld/test/ELF/gdb-index-multiple-cu-2.s
index 06316860871d..d4c32a102553 100644
--- a/lld/test/ELF/gdb-index-multiple-cu-2.s
+++ b/lld/test/ELF/gdb-index-multiple-cu-2.s
@@ -1,7 +1,7 @@
 # REQUIRES: x86
 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %p/Inputs/gdb-index-multiple-cu-2.s -o %t1.o
-# RUN: ld.lld --gdb-index %t.o %t1.o -o %t
+# RUN: ld.lld --gdb-index %t.o %t1.o -o %t 2>&1 | count 0
 # RUN: llvm-dwarfdump -gdb-index %t | FileCheck %s
 
 # %t.o has 2 CUs while %t1 has 1, thus _start in %t1.o should have cuIndex 2.
@@ -22,7 +22,7 @@
 	.long	.Lcu_end0 - .Lcu_begin0 - 4
 	.short	4              # DWARF version number
 	.long	0              # Offset Into Abbrev. Section
-	.byte	4              # Address Size
+	.byte	8              # Address Size
 	.byte	1              # Abbrev [1] DW_TAG_compile_unit
 	.byte	0
 .Lcu_end0:
@@ -30,7 +30,7 @@
 	.long	.Lcu_end1 - .Lcu_begin1 - 4
 	.short	4              # DWARF version number
 	.long	0              # Offset Into Abbrev. Section
-	.byte	4              # Address Size
+	.byte	8              # Address Size
 	.byte	1              # Abbrev [1] DW_TAG_compile_unit
 	.byte	0
 .Lcu_end1:

diff  --git a/lld/test/ELF/gdb-index-multiple-cu.s b/lld/test/ELF/gdb-index-multiple-cu.s
index 8702d9f3924d..5227681e9696 100644
--- a/lld/test/ELF/gdb-index-multiple-cu.s
+++ b/lld/test/ELF/gdb-index-multiple-cu.s
@@ -1,6 +1,6 @@
 # REQUIRES: x86
 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
-# RUN: ld.lld --gdb-index %t.o -o %t
+# RUN: ld.lld --gdb-index %t.o -o %t 2>&1 | count 0
 # RUN: llvm-dwarfdump -gdb-index %t | FileCheck %s
 
 # cuIndexAndAttrs of _start:
@@ -40,7 +40,7 @@ foo:
 	.long	.Lcu_end0 - .Lcu_begin0 - 4
 	.short	4              # DWARF version number
 	.long	0              # Offset Into Abbrev. Section
-	.byte	4              # Address Size
+	.byte	8              # Address Size
 .Ldie0:
 	.byte	1              # Abbrev [1] DW_TAG_compile_unit
 	.byte	2              # Abbrev [2] DW_TAG_subprogram
@@ -52,7 +52,7 @@ foo:
 	.long	.Lcu_end1 - .Lcu_begin1 - 4
 	.short	4              # DWARF version number
 	.long	0              # Offset Into Abbrev. Section
-	.byte	4              # Address Size
+	.byte	8              # Address Size
 .Ldie1:
 	.byte	1              # Abbrev [1] DW_TAG_compile_unit
 	.byte	2              # Abbrev [2] DW_TAG_subprogram


        


More information about the llvm-commits mailing list