[test] Make ELF tests less reliant on the lexicographical order of non-local symbols

This commit is contained in:
Fangrui Song 2021-02-13 01:01:06 -08:00
parent 905cf88d18
commit 39db16e75b
5 changed files with 38 additions and 38 deletions

View File

@ -57,14 +57,14 @@
// CHECK-X-DAG: _ZN1C1mEv
// CHECK-X-DAG: _ZN1S1nEv
// CHECK-X-RE: FUNC WEAK DEFAULT {{[0-9]+}} _ZN1C1mEv
// CHECK-X-RE: FUNC WEAK DEFAULT {{[0-9]+}} _ZN1CC2Ev
// CHECK-X-RE: FUNC WEAK DEFAULT {{[0-9]+}} _ZN1CD0Ev
// CHECK-X-RE: FUNC WEAK DEFAULT {{[0-9]+}} _ZN1CD2Ev
// CHECK-X-RE: FUNC WEAK DEFAULT {{[0-9]+}} _ZN1S1nEv
// CHECK-X-RE: FUNC WEAK DEFAULT {{[0-9]+}} _ZN1SC2Ev
// CHECK-X-RE: FUNC WEAK DEFAULT {{[0-9]+}} _ZN1SD0Ev
// CHECK-X-RE: FUNC WEAK DEFAULT {{[0-9]+}} _ZN1SD2Ev
// CHECK-X-RE-DAG: FUNC WEAK DEFAULT [[#]] _ZN1C1mEv
// CHECK-X-RE-DAG: FUNC WEAK DEFAULT [[#]] _ZN1CC2Ev
// CHECK-X-RE-DAG: FUNC WEAK DEFAULT [[#]] _ZN1CD0Ev
// CHECK-X-RE-DAG: FUNC WEAK DEFAULT [[#]] _ZN1CD2Ev
// CHECK-X-RE-DAG: FUNC WEAK DEFAULT [[#]] _ZN1S1nEv
// CHECK-X-RE-DAG: FUNC WEAK DEFAULT [[#]] _ZN1SC2Ev
// CHECK-X-RE-DAG: FUNC WEAK DEFAULT [[#]] _ZN1SD0Ev
// CHECK-X-RE-DAG: FUNC WEAK DEFAULT [[#]] _ZN1SD2Ev
// CHECK-HP2-DAG: _ZN1CC2Ev
// CHECK-HP2-DAG: _ZN1CD0Ev
@ -76,14 +76,14 @@
// CHECK-HP-NOT: _ZN1SD0Ev
// CHECK-HP-NOT: _ZN1SD2Ev
// CHECK-HP-RE: FUNC WEAK DEFAULT {{[0-9]+}} _ZN1C1mEv
// CHECK-HP-RE: FUNC WEAK DEFAULT {{[0-9]+}} _ZN1CC2Ev
// CHECK-HP-RE: FUNC WEAK DEFAULT {{[0-9]+}} _ZN1CD0Ev
// CHECK-HP-RE: FUNC WEAK DEFAULT {{[0-9]+}} _ZN1CD2Ev
// CHECK-HP-RE: FUNC WEAK HIDDEN {{[0-9]+}} _ZN1S1nEv
// CHECK-HP-RE: FUNC WEAK HIDDEN {{[0-9]+}} _ZN1SC2Ev
// CHECK-HP-RE: FUNC WEAK HIDDEN {{[0-9]+}} _ZN1SD0Ev
// CHECK-HP-RE: FUNC WEAK HIDDEN {{[0-9]+}} _ZN1SD2Ev
// CHECK-HP-RE-DAG: FUNC WEAK DEFAULT [[#]] _ZN1C1mEv
// CHECK-HP-RE-DAG: FUNC WEAK DEFAULT [[#]] _ZN1CC2Ev
// CHECK-HP-RE-DAG: FUNC WEAK DEFAULT [[#]] _ZN1CD0Ev
// CHECK-HP-RE-DAG: FUNC WEAK DEFAULT [[#]] _ZN1CD2Ev
// CHECK-HP-RE-DAG: FUNC WEAK HIDDEN [[#]] _ZN1S1nEv
// CHECK-HP-RE-DAG: FUNC WEAK HIDDEN [[#]] _ZN1SC2Ev
// CHECK-HP-RE-DAG: FUNC WEAK HIDDEN [[#]] _ZN1SD0Ev
// CHECK-HP-RE-DAG: FUNC WEAK HIDDEN [[#]] _ZN1SD2Ev
// CHECK-HC2-DAG: _ZN1SC2Ev
// CHECK-HC2-DAG: _ZN1SD0Ev
@ -95,14 +95,14 @@
// CHECK-HC-NOT: _ZN1CD0Ev
// CHECK-HC-NOT: _ZN1CD2Ev
// CHECK-HC-RE: FUNC WEAK HIDDEN {{[0-9]+}} _ZN1C1mEv
// CHECK-HC-RE: FUNC WEAK HIDDEN {{[0-9]+}} _ZN1CC2Ev
// CHECK-HC-RE: FUNC WEAK HIDDEN {{[0-9]+}} _ZN1CD0Ev
// CHECK-HC-RE: FUNC WEAK HIDDEN {{[0-9]+}} _ZN1CD2Ev
// CHECK-HC-RE: FUNC WEAK DEFAULT {{[0-9]+}} _ZN1S1nEv
// CHECK-HC-RE: FUNC WEAK DEFAULT {{[0-9]+}} _ZN1SC2Ev
// CHECK-HC-RE: FUNC WEAK DEFAULT {{[0-9]+}} _ZN1SD0Ev
// CHECK-HC-RE: FUNC WEAK DEFAULT {{[0-9]+}} _ZN1SD2Ev
// CHECK-HC-RE-DAG: FUNC WEAK HIDDEN [[#]] _ZN1C1mEv
// CHECK-HC-RE-DAG: FUNC WEAK HIDDEN [[#]] _ZN1CC2Ev
// CHECK-HC-RE-DAG: FUNC WEAK HIDDEN [[#]] _ZN1CD0Ev
// CHECK-HC-RE-DAG: FUNC WEAK HIDDEN [[#]] _ZN1CD2Ev
// CHECK-HC-RE-DAG: FUNC WEAK DEFAULT [[#]] _ZN1S1nEv
// CHECK-HC-RE-DAG: FUNC WEAK DEFAULT [[#]] _ZN1SC2Ev
// CHECK-HC-RE-DAG: FUNC WEAK DEFAULT [[#]] _ZN1SD0Ev
// CHECK-HC-RE-DAG: FUNC WEAK DEFAULT [[#]] _ZN1SD2Ev
// CHECK-HP-HC-NOT: _ZN1CC2Ev
// CHECK-HP-HC-NOT: _ZN1CD0Ev
@ -113,14 +113,14 @@
// CHECK-HP-HC-NOT: _ZN1C1mEv
// CHECK-HP-HC-NOT: _ZN1S1nEv
// CHECK-HP-HC-RE: FUNC WEAK HIDDEN {{[0-9]+}} _ZN1C1mEv
// CHECK-HP-HC-RE: FUNC WEAK HIDDEN {{[0-9]+}} _ZN1CC2Ev
// CHECK-HP-HC-RE: FUNC WEAK HIDDEN {{[0-9]+}} _ZN1CD0Ev
// CHECK-HP-HC-RE: FUNC WEAK HIDDEN {{[0-9]+}} _ZN1CD2Ev
// CHECK-HP-HC-RE: FUNC WEAK HIDDEN {{[0-9]+}} _ZN1S1nEv
// CHECK-HP-HC-RE: FUNC WEAK HIDDEN {{[0-9]+}} _ZN1SC2Ev
// CHECK-HP-HC-RE: FUNC WEAK HIDDEN {{[0-9]+}} _ZN1SD0Ev
// CHECK-HP-HC-RE: FUNC WEAK HIDDEN {{[0-9]+}} _ZN1SD2Ev
// CHECK-HP-HC-RE-DAG: FUNC WEAK HIDDEN [[#]] _ZN1C1mEv
// CHECK-HP-HC-RE-DAG: FUNC WEAK HIDDEN [[#]] _ZN1CC2Ev
// CHECK-HP-HC-RE-DAG: FUNC WEAK HIDDEN [[#]] _ZN1CD0Ev
// CHECK-HP-HC-RE-DAG: FUNC WEAK HIDDEN [[#]] _ZN1CD2Ev
// CHECK-HP-HC-RE-DAG: FUNC WEAK HIDDEN [[#]] _ZN1S1nEv
// CHECK-HP-HC-RE-DAG: FUNC WEAK HIDDEN [[#]] _ZN1SC2Ev
// CHECK-HP-HC-RE-DAG: FUNC WEAK HIDDEN [[#]] _ZN1SD0Ev
// CHECK-HP-HC-RE-DAG: FUNC WEAK HIDDEN [[#]] _ZN1SD2Ev
// TODO: clang+llvm does not materialize complete ctors and dtors for the
// Itanium abi. Figure out why and add the check-not for these:

View File

@ -50,9 +50,9 @@
; OSABI-AMDHSA-ELF: .rodata PROGBITS {{[0-9]+}} {{[0-9]+}} {{[0-9a-f]+}} {{[0-9]+}} A {{[0-9]+}} {{[0-9]+}} 64
; OSABI-AMDHSA-ELF: Relocation section '.rela.rodata' at offset
; OSABI-AMDHSA-ELF: 0000000000000010 0000000300000005 R_AMDGPU_REL64 0000000000000000 fadd + 10
; OSABI-AMDHSA-ELF: 0000000000000050 0000000500000005 R_AMDGPU_REL64 0000000000000100 fsub + 10
; OSABI-AMDHSA-ELF: 0000000000000090 0000000100000005 R_AMDGPU_REL64 0000000000000200 empty + 10
; OSABI-AMDHSA-ELF: R_AMDGPU_REL64 0000000000000000 fadd + 10
; OSABI-AMDHSA-ELF: R_AMDGPU_REL64 0000000000000100 fsub + 10
; OSABI-AMDHSA-ELF: R_AMDGPU_REL64 0000000000000200 empty + 10
; OSABI-AMDHSA-ELF: Symbol table '.symtab' contains {{[0-9]+}} entries
; OSABI-AMDHSA-ELF: {{[0-9]+}}: 0000000000000000 {{[0-9]+}} FUNC GLOBAL PROTECTED {{[0-9]+}} fadd

View File

@ -46,7 +46,7 @@ define i32 @GeneralDynamicValueLoad() {
; CHECK-O-NEXT: 58: 00 00 63 80 lwz 3, 0(3)
; CHECK-SYM-LABEL: Symbol table '.symtab' contains 7 entries
; CHECK-SYM: 6: 0000000000000000 0 TLS GLOBAL DEFAULT UND x
; CHECK-SYM: 0000000000000000 0 TLS GLOBAL DEFAULT UND x
entry:
%0 = load i32, i32* @x, align 4
ret i32 %0

View File

@ -43,7 +43,7 @@ define i32 @InitialExecValueLoad() {
; CHECK-O-NEXT: 20 00 80 4e blr
; CHECK-SYM-LABEL: Symbol table '.symtab' contains 6 entries
; CHECK-SYM: 5: 0000000000000000 0 TLS GLOBAL DEFAULT UND x
; CHECK-SYM: 0000000000000000 0 TLS GLOBAL DEFAULT UND x
entry:
%0 = load i32, i32* @x, align 4
ret i32 %0

View File

@ -35,7 +35,7 @@
; should not be set.
; RUN: llvm-bcanalyzer --dump %t1.o.thinlto.bc | FileCheck %s -check-prefixes=CHECK-BC1
; CHECK-BC1: <GLOBALVAL_SUMMARY_BLOCK
; CHECK-BC1: <FLAGS op0=33/>
; CHECK-BC1: <FLAGS op0=[[#]]/>
; CHECK-BC1: </GLOBALVAL_SUMMARY_BLOCK
; Nothing interesting in the corresponding object file, so