xref: /llvm-project/lld/test/ELF/version-script-warn.s (revision 1037f577bd66ab03bc494120f024f2a52008e285)
1# REQUIRES: x86
2# RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o
3
4# RUN: echo 'foo { *; }; bar { *; };' > %t.ver
5# RUN: ld.lld --version-script %t.ver %t.o -shared -o %t.so 2>&1 | \
6# RUN:   FileCheck --check-prefix=MULTVER %s
7
8# RUN: echo '{ global: *; local: *;};' > %t.ver
9# RUN: ld.lld --version-script %t.ver %t.o -shared -o %t.so 2>&1 | \
10# RUN:   FileCheck --check-prefix=LOCGLOB %s
11
12# RUN: echo 'V1 { global: *; }; V2 { local: *;};' > %t.ver
13# RUN: ld.lld --version-script %t.ver %t.o -shared -o %t.so 2>&1 | \
14# RUN:   FileCheck --check-prefix=LOCGLOB %s
15
16# RUN: echo 'V1 { local: *; }; V2 { global: *;};' > %t.ver
17# RUN: ld.lld --version-script %t.ver %t.o -shared -o %t.so 2>&1 | \
18# RUN:   FileCheck --check-prefix=LOCGLOB %s
19
20# RUN: echo 'V1 { local: *; }; V2 { local: *;};' > %t.ver
21# RUN: ld.lld --version-script %t.ver %t.o -shared -o %t.so --fatal-warnings
22
23## --retain-symbols-file uses the same internal infrastructure as the support
24## for version scripts. Do not show the warings if they both are used.
25# RUN: echo 'foo' > %t_retain.txt
26# RUN: echo '{ local: *; };' > %t_local.ver
27# RUN: echo '{ global: *; };' > %t_global.ver
28# RUN: ld.lld --retain-symbols-file=%t_retain.txt --version-script %t_local.ver %t.o -shared -o %t.so --fatal-warnings
29# RUN: ld.lld --retain-symbols-file=%t_retain.txt --version-script %t_global.ver %t.o -shared -o %t.so --fatal-warnings
30
31# MULTVER: warning: wildcard pattern '*' is used for multiple version definitions in version script
32# LOCGLOB: warning: wildcard pattern '*' is used for both 'local' and 'global' scopes in version script
33
34.globl foo
35foo:
36