Skip to content

Commit

Permalink
[ELF][test] Make tests less sensitive to addresses/number of sections
Browse files Browse the repository at this point in the history
  • Loading branch information
MaskRay committed Sep 11, 2023
1 parent 90db419 commit fcc761b
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 21 deletions.
2 changes: 1 addition & 1 deletion lld/test/ELF/common-shared.s
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# RUN: ld.lld %t1.so %t.o -o %t
# RUN: llvm-readelf -s %t | FileCheck %s

# CHECK: 16 OBJECT GLOBAL DEFAULT 7 com
# CHECK: 16 OBJECT GLOBAL DEFAULT [[#]] com

.globl com
.comm com,1
2 changes: 1 addition & 1 deletion lld/test/ELF/pr34660.s
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# DISASM-NEXT: 1022c: ldr x8, 0x30294

# SYM: Symbol table '.symtab'
# SYM: 0000000000030294 0 NOTYPE LOCAL DEFAULT 6 patatino
# SYM: 0000000000030294 0 NOTYPE LOCAL DEFAULT [[#]] patatino

ldr x8, patatino
.data
Expand Down
28 changes: 14 additions & 14 deletions lld/test/ELF/section-name.s
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,17 @@ _start:
.section .tdata.foo,"aGwT",@progbits,foo,comdat
.byte 0

// CHECK: 1 .rodata 00000002
// CHECK: 2 .gcc_except_table 00000001
// CHECK: 3 .text 00000002
// CHECK: 4 .tdata 00000001
// CHECK: 5 .tbss 00000001
// CHECK: 6 .data.rel.ro 00000004
// CHECK: 7 .data 00000002
// CHECK: 8 .foo.a 00000001
// CHECK: 9 .foo 00000001
// CHECK: 10 .bss 00000002
// CHECK: 11 .comment 00000008
// CHECK: 12 .symtab 00000030
// CHECK: 13 .shstrtab 00000075
// CHECK: 14 .strtab 00000008
// CHECK: .rodata 00000002
// CHECK-NEXT: .gcc_except_table 00000001
// CHECK-NEXT: .text 00000002
// CHECK-NEXT: .tdata 00000001
// CHECK-NEXT: .tbss 00000001
// CHECK-NEXT: .data.rel.ro 00000004
// CHECK-NEXT: .data 00000002
// CHECK-NEXT: .foo.a 00000001
// CHECK-NEXT: .foo 00000001
// CHECK-NEXT: .bss 00000002
// CHECK-NEXT: .comment 00000008
// CHECK-NEXT: .symtab 00000030
// CHECK-NEXT: .shstrtab 00000075
// CHECK-NEXT: .strtab 00000008
4 changes: 2 additions & 2 deletions lld/test/ELF/synthetic-got.s
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
# RUN: | FileCheck %s --check-prefix=GOTDATA

# GOT: Sections:
# GOT: 9 .got 00000008 00000000000001b0 DATA
# GOT: 10 .got.plt 00000020 00000000000001b8 DATA
# GOT: .got 00000008 00000000000001b0 DATA
# GOT: .got.plt 00000020 00000000000001b8 DATA
# GOTDATA: Contents of section .got:
# GOTDATA-NEXT: 01b0 00000000 00000000
# GOTDATA-NEXT: Contents of section .got.plt:
Expand Down
4 changes: 1 addition & 3 deletions lld/test/ELF/tls.s
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,12 @@ d:
// CHECK-NEXT: EntrySize:
// CHECK-NEXT: }

// Check that the TLS NOBITS sections weren't added to the R/W PT_LOAD's size.

// CHECK: ProgramHeaders [
// CHECK: Type: PT_LOAD
// CHECK: Type: PT_LOAD
// CHECK: Type: PT_LOAD
// CHECK: FileSize: 8
// CHECK-NEXT: MemSize: 8
// CHECK-NEXT: MemSize: [[#]]
// CHECK-NEXT: Flags [
// CHECK-NEXT: PF_R
// CHECK-NEXT: PF_W
Expand Down

0 comments on commit fcc761b

Please sign in to comment.