2016-06-20 19:55:12 +08:00
|
|
|
; REQUIRES: x86
|
|
|
|
; RUN: llvm-as %s -o %t.o
|
|
|
|
; RUN: echo "VERSION_1.0{ global: foo; local: *; }; VERSION_2.0{ global: bar; local: *; };" > %t.script
|
2018-05-31 01:57:08 +08:00
|
|
|
; RUN: ld.lld %t.o -o %t2 -shared --version-script %t.script -save-temps
|
2016-09-29 08:40:08 +08:00
|
|
|
; RUN: llvm-dis < %t2.0.0.preopt.bc | FileCheck %s
|
2019-09-07 16:20:09 +08:00
|
|
|
; RUN: llvm-readobj --dyn-syms %t2 | FileCheck --check-prefix=DSO %s
|
2016-06-20 19:55:12 +08:00
|
|
|
|
|
|
|
target triple = "x86_64-unknown-linux-gnu"
|
2019-09-11 07:15:38 +08:00
|
|
|
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
|
2016-06-20 19:55:12 +08:00
|
|
|
|
|
|
|
define void @foo() {
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @bar() {
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK: define void @foo()
|
|
|
|
; CHECK: define void @bar()
|
|
|
|
|
|
|
|
; DSO: DynamicSymbols [
|
|
|
|
; DSO: Symbol {
|
2019-01-08 18:50:59 +08:00
|
|
|
; DSO: Name:
|
2016-06-20 19:55:12 +08:00
|
|
|
; 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
|
2019-09-07 16:20:09 +08:00
|
|
|
; DSO: Value:
|
2016-06-20 19:55:12 +08:00
|
|
|
; DSO: Size: 1
|
|
|
|
; DSO: Binding: Global
|
|
|
|
; DSO: Type: Function
|
|
|
|
; DSO: Other: 0
|
|
|
|
; DSO: Section: .text
|
|
|
|
; DSO: }
|
|
|
|
; DSO: Symbol {
|
|
|
|
; DSO: Name: bar@@VERSION_2.0
|
2019-09-07 16:20:09 +08:00
|
|
|
; DSO: Value:
|
2016-06-20 19:55:12 +08:00
|
|
|
; DSO: Size: 1
|
|
|
|
; DSO: Binding: Global
|
|
|
|
; DSO: Type: Function
|
|
|
|
; DSO: Other: 0
|
|
|
|
; DSO: Section: .text
|
|
|
|
; DSO: }
|
|
|
|
; DSO: ]
|