aboutsummaryrefslogtreecommitdiff
path: root/test/ELF/lto/version-script.ll
blob: 35a36b5a8d788ab0628dc67a39b9d137407a7721 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
; 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
; 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 -V -dyn-symbols %t2 | FileCheck --check-prefix=DSO %s

target triple = "x86_64-unknown-linux-gnu"
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"

define void @foo() {
  ret void
}

define void @bar() {
  ret void
}

; CHECK: define void @foo()
; CHECK: define void @bar()

; DSO: DynamicSymbols [
; DSO:   Symbol {
; DSO:     Name: @ (0)
; 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: 0x1000
; 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: 0x1010
; DSO:     Size: 1
; DSO:     Binding: Global
; DSO:     Type: Function
; DSO:     Other: 0
; DSO:     Section: .text
; DSO:   }
; DSO: ]