aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFangrui Song <i@maskray.me>2025-01-26 20:20:51 -0800
committerFangrui Song <i@maskray.me>2025-01-26 20:20:51 -0800
commit0e6b58202ca9c4d1ca814e4bea5bd3f0bac7f329 (patch)
tree8b5afe967bd8eb7f1eac7a59e649bde511ca3421
parent7107f55d82f8d1077d5478e8f58c94851385c06f (diff)
downloadllvm-0e6b58202ca9c4d1ca814e4bea5bd3f0bac7f329.zip
llvm-0e6b58202ca9c4d1ca814e4bea5bd3f0bac7f329.tar.gz
llvm-0e6b58202ca9c4d1ca814e4bea5bd3f0bac7f329.tar.bz2
[ELF] Improve parseSymbolVersion tests in for compileBitcodeFiles
Otherwise, the tests won't catch a mistake that removes `parseSymbolVersion`.
-rw-r--r--lld/test/ELF/lto/version-script.ll34
-rw-r--r--lld/test/ELF/lto/version-script2.ll8
2 files changed, 8 insertions, 34 deletions
diff --git a/lld/test/ELF/lto/version-script.ll b/lld/test/ELF/lto/version-script.ll
index 52b9afc..54a5e01 100644
--- a/lld/test/ELF/lto/version-script.ll
+++ b/lld/test/ELF/lto/version-script.ll
@@ -3,7 +3,7 @@
; RUN: echo "VERSION_1.0{ global: foo; local: *; }; VERSION_2.0{ global: bar; local: *; };" > %t.script
; RUN: ld.lld %t.o -o %t2 -shared --version-script %t.script -save-temps
; RUN: llvm-dis < %t2.0.0.preopt.bc | FileCheck %s
-; RUN: llvm-readobj --dyn-syms %t2 | FileCheck --check-prefix=DSO %s
+; RUN: llvm-readelf --dyn-syms %t2 | FileCheck --check-prefix=DSO %s
target triple = "x86_64-unknown-linux-gnu"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
@@ -19,32 +19,6 @@ define void @bar() {
; CHECK: define void @foo()
; CHECK: define void @bar()
-; DSO: DynamicSymbols [
-; DSO: Symbol {
-; DSO: Name:
-; DSO: Value: 0x0
-; DSO: Size: 0
-; DSO: Binding: Local
-; DSO: Type: None
-; DSO: Other: 0
-; DSO: Section: Undefined
-; DSO: }
-; DSO: Symbol {
-; DSO: Name: foo@@VERSION_1.0
-; DSO: Value:
-; DSO: Size: 1
-; DSO: Binding: Global
-; DSO: Type: Function
-; DSO: Other: 0
-; DSO: Section: .text
-; DSO: }
-; DSO: Symbol {
-; DSO: Name: bar@@VERSION_2.0
-; DSO: Value:
-; DSO: Size: 1
-; DSO: Binding: Global
-; DSO: Type: Function
-; DSO: Other: 0
-; DSO: Section: .text
-; DSO: }
-; DSO: ]
+; DSO: Symbol table '.dynsym' contains 3 entries:
+; DSO: 1: {{.*}} 1 FUNC GLOBAL DEFAULT [[#]] foo@@VERSION_1.0{{$}}
+; DSO: 2: {{.*}} 1 FUNC GLOBAL DEFAULT [[#]] bar@@VERSION_2.0{{$}}
diff --git a/lld/test/ELF/lto/version-script2.ll b/lld/test/ELF/lto/version-script2.ll
index dab2275..5635731 100644
--- a/lld/test/ELF/lto/version-script2.ll
+++ b/lld/test/ELF/lto/version-script2.ll
@@ -17,16 +17,16 @@
; RUN: ld.lld %t.o %tbar.so -o %t.so -shared --version-script %t/ver
; RUN: llvm-readelf --dyn-syms %t.so | FileCheck %s
-; CHECK: UND bar@VER1
-; CHECK-NEXT: {{[1-9]}} foo@@VER1
+; CHECK: UND bar@VER1{{$}}
+; CHECK-NEXT: {{[1-9]}} foo@@VER1{{$}}
;; For relocatable output, @ should be retained in the symbol name.
;; Don't parse and drop `@VER1`. Also check that --version-script is ignored.
; RUN: ld.lld %t.o -o %t.ro -r --version-script %t/ver
; RUN: llvm-readelf -s %t.ro | FileCheck %s --check-prefix=RELOCATABLE
-; RELOCATABLE: {{[1-9]}} foo@@VER1
-; RELOCATABLE-NEXT: UND bar@VER1
+; RELOCATABLE: {{[1-9]}} foo@@VER1{{$}}
+; RELOCATABLE-NEXT: UND bar@VER1{{$}}
;--- ver
VER1 {};