From d87b1eed8e929dc997b9b1c826299f35e33c6060 Mon Sep 17 00:00:00 2001 From: George Rimar Date: Thu, 5 Jul 2018 14:01:54 +0000 Subject: [PATCH] [ELF] - Test we are able to assign version to symbols that are not "_Z*" This is to test the following line of the code: https://github.com/llvm-mirror/lld/blob/master/ELF/SymbolTable.cpp#L681 If symbol does not start from _Z prefix and we have extern "C++", we do not call demangler and use its name as is. llvm-svn: 336353 --- lld/test/ELF/version-script-extern2.s | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 lld/test/ELF/version-script-extern2.s diff --git a/lld/test/ELF/version-script-extern2.s b/lld/test/ELF/version-script-extern2.s new file mode 100644 index 0000000..834bbe1 --- /dev/null +++ b/lld/test/ELF/version-script-extern2.s @@ -0,0 +1,22 @@ +# REQUIRES: x86 + +# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o +# RUN: echo "FOO { global: extern \"C++\" { \"bar\"; }; };" > %t.script +# RUN: ld.lld --version-script %t.script -shared %t.o -o %t.so +# RUN: llvm-readobj -V %t.so | FileCheck %s + +# CHECK: Symbols [ +# CHECK-NEXT: Symbol { +# CHECK-NEXT: Version: 0 +# CHECK-NEXT: Name: @ +# CHECK-NEXT: } +# CHECK-NEXT: Symbol { +# CHECK-NEXT: Version: 2 +# CHECK-NEXT: Name: bar@@FOO +# CHECK-NEXT: } +# CHECK-NEXT: ] + +.globl bar +.type bar,@function +bar: +retq -- 2.7.4