blob: 220aded0427a580dc5750c7e95ef34c698cc834f [file] [log] [blame]
George Rimar8825a5c2016-09-07 09:59:29 +00001# REQUIRES: x86
George Rimar50dcece2016-07-16 12:26:39 +00002
3# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
4# RUN: echo "LIBSAMPLE_1.0 { \
5# RUN: global: \
George Rimar8825a5c2016-09-07 09:59:29 +00006# RUN: extern \"C++\" { \
7# RUN: \"foo(int)\"; \
8# RUN: \"zed(int)\"; \
George Rimar50dcece2016-07-16 12:26:39 +00009# RUN: }; \
10# RUN: }; \
11# RUN: LIBSAMPLE_2.0 { \
12# RUN: global: \
George Rimar8825a5c2016-09-07 09:59:29 +000013# RUN: extern \"C++\" { \
14# RUN: \"bar(int)\"; \
George Rimar50dcece2016-07-16 12:26:39 +000015# RUN: }; \
16# RUN: }; " > %t.script
17# RUN: ld.lld --version-script %t.script -shared %t.o -o %t.so
18# RUN: llvm-readobj -V -dyn-symbols %t.so | FileCheck --check-prefix=DSO %s
19
20# DSO: DynamicSymbols [
21# DSO-NEXT: Symbol {
22# DSO-NEXT: Name: @
23# DSO-NEXT: Value: 0x0
24# DSO-NEXT: Size: 0
25# DSO-NEXT: Binding: Local
26# DSO-NEXT: Type: None
27# DSO-NEXT: Other: 0
28# DSO-NEXT: Section: Undefined
29# DSO-NEXT: }
30# DSO-NEXT: Symbol {
31# DSO-NEXT: Name: _Z3bari@@LIBSAMPLE_2.0
32# DSO-NEXT: Value: 0x1001
33# DSO-NEXT: Size: 0
34# DSO-NEXT: Binding: Global
35# DSO-NEXT: Type: Function
36# DSO-NEXT: Other: 0
37# DSO-NEXT: Section: .text
38# DSO-NEXT: }
39# DSO-NEXT: Symbol {
40# DSO-NEXT: Name: _Z3fooi@@LIBSAMPLE_1.0
41# DSO-NEXT: Value: 0x1000
42# DSO-NEXT: Size: 0
43# DSO-NEXT: Binding: Global
44# DSO-NEXT: Type: Function
45# DSO-NEXT: Other: 0
46# DSO-NEXT: Section: .text
47# DSO-NEXT: }
48# DSO-NEXT: Symbol {
49# DSO-NEXT: Name: _Z3zedi@@LIBSAMPLE_1.0
50# DSO-NEXT: Value: 0x1002
51# DSO-NEXT: Size: 0
52# DSO-NEXT: Binding: Global (0x1)
53# DSO-NEXT: Type: Function (0x2)
54# DSO-NEXT: Other: 0
55# DSO-NEXT: Section: .text (0x6)
56# DSO-NEXT: }
57# DSO-NEXT: ]
58# DSO-NEXT: Version symbols {
59# DSO-NEXT: Section Name: .gnu.version
60# DSO-NEXT: Address: 0x228
61# DSO-NEXT: Offset: 0x228
62# DSO-NEXT: Link: 1
63# DSO-NEXT: Symbols [
64# DSO-NEXT: Symbol {
65# DSO-NEXT: Version: 0
66# DSO-NEXT: Name: @
67# DSO-NEXT: }
68# DSO-NEXT: Symbol {
69# DSO-NEXT: Version: 3
70# DSO-NEXT: Name: _Z3bari@@LIBSAMPLE_2.0
71# DSO-NEXT: }
72# DSO-NEXT: Symbol {
73# DSO-NEXT: Version: 2
74# DSO-NEXT: Name: _Z3fooi@@LIBSAMPLE_1.0
75# DSO-NEXT: }
76# DSO-NEXT: Symbol {
77# DSO-NEXT: Version: 2
78# DSO-NEXT: Name: _Z3zedi@@LIBSAMPLE_1.0
79# DSO-NEXT: }
80# DSO-NEXT: ]
81# DSO-NEXT: }
82
83.text
84.globl _Z3fooi
85.type _Z3fooi,@function
86_Z3fooi:
87retq
88
89.globl _Z3bari
90.type _Z3bari,@function
91_Z3bari:
92retq
93
94.globl _Z3zedi
95.type _Z3zedi,@function
96_Z3zedi:
97retq