summaryrefslogtreecommitdiff
path: root/test/ELF/version-script-extern.s
diff options
context:
space:
mode:
Diffstat (limited to 'test/ELF/version-script-extern.s')
-rw-r--r--test/ELF/version-script-extern.s61
1 files changed, 45 insertions, 16 deletions
diff --git a/test/ELF/version-script-extern.s b/test/ELF/version-script-extern.s
index 439653487bc0..2b89839c369a 100644
--- a/test/ELF/version-script-extern.s
+++ b/test/ELF/version-script-extern.s
@@ -1,19 +1,12 @@
-# REQUIRES: shell
+# REQUIRES: x86
# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
-# RUN: echo "LIBSAMPLE_1.0 { \
-# RUN: global: \
-# RUN: extern "C++" { \
-# RUN: \"foo(int)\"; \
-# RUN: \"zed(int)\"; \
-# RUN: }; \
-# RUN: }; \
-# RUN: LIBSAMPLE_2.0 { \
-# RUN: global: \
-# RUN: extern "C++" { \
-# RUN: \"bar(int)\"; \
-# RUN: }; \
-# RUN: }; " > %t.script
+# RUN: echo "LIBSAMPLE_1.0 { global:" > %t.script
+# RUN: echo ' extern "C++" { "foo(int)"; "zed(int)"; "abc::abc()"; };' >> %t.script
+# RUN: echo "};" >> %t.script
+# RUN: echo "LIBSAMPLE_2.0 { global:" >> %t.script
+# RUN: echo ' extern "C" { _Z3bari; };' >> %t.script
+# RUN: echo "};" >> %t.script
# RUN: ld.lld --version-script %t.script -shared %t.o -o %t.so
# RUN: llvm-readobj -V -dyn-symbols %t.so | FileCheck --check-prefix=DSO %s
@@ -54,11 +47,29 @@
# DSO-NEXT: Other: 0
# DSO-NEXT: Section: .text (0x6)
# DSO-NEXT: }
+# DSO-NEXT: Symbol {
+# DSO-NEXT: Name: _ZN3abcC1Ev@@LIBSAMPLE_1.0
+# DSO-NEXT: Value: 0x1003
+# DSO-NEXT: Size: 0
+# DSO-NEXT: Binding: Global (0x1)
+# DSO-NEXT: Type: Function (0x2)
+# DSO-NEXT: Other: 0
+# DSO-NEXT: Section: .text (0x6)
+# DSO-NEXT: }
+# DSO-NEXT: Symbol {
+# DSO-NEXT: Name: _ZN3abcC2Ev@@LIBSAMPLE_1.0
+# DSO-NEXT: Value: 0x1004
+# DSO-NEXT: Size: 0
+# DSO-NEXT: Binding: Global (0x1)
+# DSO-NEXT: Type: Function (0x2)
+# DSO-NEXT: Other: 0
+# DSO-NEXT: Section: .text (0x6)
+# DSO-NEXT: }
# DSO-NEXT: ]
# DSO-NEXT: Version symbols {
# DSO-NEXT: Section Name: .gnu.version
-# DSO-NEXT: Address: 0x228
-# DSO-NEXT: Offset: 0x228
+# DSO-NEXT: Address: 0x258
+# DSO-NEXT: Offset: 0x258
# DSO-NEXT: Link: 1
# DSO-NEXT: Symbols [
# DSO-NEXT: Symbol {
@@ -77,6 +88,14 @@
# DSO-NEXT: Version: 2
# DSO-NEXT: Name: _Z3zedi@@LIBSAMPLE_1.0
# DSO-NEXT: }
+# DSO-NEXT: Symbol {
+# DSO-NEXT: Version: 2
+# DSO-NEXT: Name: _ZN3abcC1Ev@@LIBSAMPLE_1.0
+# DSO-NEXT: }
+# DSO-NEXT: Symbol {
+# DSO-NEXT: Version: 2
+# DSO-NEXT: Name: _ZN3abcC2Ev@@LIBSAMPLE_1.0
+# DSO-NEXT: }
# DSO-NEXT: ]
# DSO-NEXT: }
@@ -95,3 +114,13 @@ retq
.type _Z3zedi,@function
_Z3zedi:
retq
+
+.globl _ZN3abcC1Ev
+.type _ZN3abcC1Ev,@function
+_ZN3abcC1Ev:
+retq
+
+.globl _ZN3abcC2Ev
+.type _ZN3abcC2Ev,@function
+_ZN3abcC2Ev:
+retq