3 # RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o
5 # RUN: echo 'v1 { local: extern "C++" { "foo1()"; "foo3(int)"; }; }; v2 { local: extern "C++" { "foo2()"; "foo4(int)"; }; };' > %t1.script
6 # RUN: ld.lld --version-script %t1.script -shared %t.o -o %t1.so
7 # RUN: llvm-readelf --dyn-syms %t1.so | FileCheck --check-prefix=EXACT %s
9 # EXACT-NEXT: [[#]] _start{{$}}
12 # RUN: echo 'v1 { global: *; local: extern "C++" {foo*;}; }; v2 { global: extern "C++" {"foo2()";}; };' > %t2.script
13 # RUN: ld.lld --version-script %t2.script -shared %t.o -o %t2.so
14 # RUN: llvm-readelf --dyn-syms %t2.so | FileCheck --check-prefix=MIX1 %s
16 # MIX1-NEXT: [[#]] _Z4foo2v@@v2
17 # MIX1-NEXT: [[#]] _start@@v1
18 # MIX1-NEXT: [[#]] _Z4foo4i@@v2
21 # RUN: echo 'v1 { local: extern "C++" {foo*;}; }; v2 { global: extern "C++" {"foo2()";}; };' > %t3.script
22 # RUN: ld.lld --version-script %t3.script -shared %t.o -o %t3.so
23 # RUN: llvm-readelf --dyn-syms %t3.so | FileCheck --check-prefix=MIX2 %s
25 # MIX2-NEXT: [[#]] _Z4foo2v@@v2
26 # MIX2-NEXT: [[#]] _start{{$}}
27 # MIX2-NEXT: [[#]] _Z4foo4i@@v2
30 # RUN: echo 'v1 { global: extern "C++" {foo*;}; local: *; }; v2 { global: extern "C++" {"foo4(int)";}; local: *; };' > %t4.script
31 # RUN: ld.lld --version-script %t4.script -shared %t.o -o %t4.so
32 # RUN: llvm-readelf --dyn-syms %t4.so | FileCheck --check-prefix=MIX3 %s
34 # MIX3-NEXT: [[#]] _Z4foo1v@@v1
35 # MIX3-NEXT: [[#]] _Z4foo2v@@v1
36 # MIX3-NEXT: [[#]] _Z4foo3i@v1
37 # MIX3-NEXT: [[#]] _Z4foo4i@@v2
40 .globl _Z4foo1v; _Z4foo1v: ret
41 .globl _Z4foo2v; _Z4foo2v: ret
42 .globl _Z4foo3i; .symver _Z4foo3i,_Z4foo3i@v1,remove; _Z4foo3i: ret
43 .globl _Z4foo4i; .symver _Z4foo4i,_Z4foo4i@@@v2; _Z4foo4i: ret
45 .globl _start; _start: ret