• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; REQUIRES: x86
2; RUN: llvm-as %s -o %t.o
3; RUN: echo "VERSION_1.0{ global: foo; local: *; }; VERSION_2.0{ global: bar; local: *; };" > %t.script
4; RUN: ld.lld %t.o -o %t2 -shared --version-script %t.script -save-temps
5; RUN: llvm-dis < %t2.0.0.preopt.bc | FileCheck %s
6; RUN: llvm-readobj --dyn-syms %t2 | FileCheck --check-prefix=DSO %s
7
8target triple = "x86_64-unknown-linux-gnu"
9target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
10
11define void @foo() {
12  ret void
13}
14
15define void @bar() {
16  ret void
17}
18
19; CHECK: define void @foo()
20; CHECK: define void @bar()
21
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: ]
51