Skip to content

Commit 0e6b582

Browse files
committed
[ELF] Improve parseSymbolVersion tests in for compileBitcodeFiles
Otherwise, the tests won't catch a mistake that removes `parseSymbolVersion`.
1 parent 7107f55 commit 0e6b582

File tree

2 files changed

+8
-34
lines changed

2 files changed

+8
-34
lines changed

lld/test/ELF/lto/version-script.ll

Lines changed: 4 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
; RUN: echo "VERSION_1.0{ global: foo; local: *; }; VERSION_2.0{ global: bar; local: *; };" > %t.script
44
; RUN: ld.lld %t.o -o %t2 -shared --version-script %t.script -save-temps
55
; RUN: llvm-dis < %t2.0.0.preopt.bc | FileCheck %s
6-
; RUN: llvm-readobj --dyn-syms %t2 | FileCheck --check-prefix=DSO %s
6+
; RUN: llvm-readelf --dyn-syms %t2 | FileCheck --check-prefix=DSO %s
77

88
target triple = "x86_64-unknown-linux-gnu"
99
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() {
1919
; CHECK: define void @foo()
2020
; CHECK: define void @bar()
2121

22-
; DSO: DynamicSymbols [
23-
; DSO: Symbol {
24-
; DSO: Name:
25-
; DSO: Value: 0x0
26-
; DSO: Size: 0
27-
; DSO: Binding: Local
28-
; DSO: Type: None
29-
; DSO: Other: 0
30-
; DSO: Section: Undefined
31-
; DSO: }
32-
; DSO: Symbol {
33-
; DSO: Name: foo@@VERSION_1.0
34-
; DSO: Value:
35-
; DSO: Size: 1
36-
; DSO: Binding: Global
37-
; DSO: Type: Function
38-
; DSO: Other: 0
39-
; DSO: Section: .text
40-
; DSO: }
41-
; DSO: Symbol {
42-
; DSO: Name: bar@@VERSION_2.0
43-
; DSO: Value:
44-
; DSO: Size: 1
45-
; DSO: Binding: Global
46-
; DSO: Type: Function
47-
; DSO: Other: 0
48-
; DSO: Section: .text
49-
; DSO: }
50-
; DSO: ]
22+
; DSO: Symbol table '.dynsym' contains 3 entries:
23+
; DSO: 1: {{.*}} 1 FUNC GLOBAL DEFAULT [[#]] foo@@VERSION_1.0{{$}}
24+
; DSO: 2: {{.*}} 1 FUNC GLOBAL DEFAULT [[#]] bar@@VERSION_2.0{{$}}

lld/test/ELF/lto/version-script2.ll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@
1717
; RUN: ld.lld %t.o %tbar.so -o %t.so -shared --version-script %t/ver
1818
; RUN: llvm-readelf --dyn-syms %t.so | FileCheck %s
1919

20-
; CHECK: UND bar@VER1
21-
; CHECK-NEXT: {{[1-9]}} foo@@VER1
20+
; CHECK: UND bar@VER1{{$}}
21+
; CHECK-NEXT: {{[1-9]}} foo@@VER1{{$}}
2222

2323
;; For relocatable output, @ should be retained in the symbol name.
2424
;; Don't parse and drop `@VER1`. Also check that --version-script is ignored.
2525
; RUN: ld.lld %t.o -o %t.ro -r --version-script %t/ver
2626
; RUN: llvm-readelf -s %t.ro | FileCheck %s --check-prefix=RELOCATABLE
2727

28-
; RELOCATABLE: {{[1-9]}} foo@@VER1
29-
; RELOCATABLE-NEXT: UND bar@VER1
28+
; RELOCATABLE: {{[1-9]}} foo@@VER1{{$}}
29+
; RELOCATABLE-NEXT: UND bar@VER1{{$}}
3030

3131
;--- ver
3232
VER1 {};

0 commit comments

Comments
 (0)