diff --git a/lld/test/ELF/version-script-complex-wildcards.s b/lld/test/ELF/version-script-complex-wildcards.s index 2ade9c5c6231..8291c25bed50 100644 --- a/lld/test/ELF/version-script-complex-wildcards.s +++ b/lld/test/ELF/version-script-complex-wildcards.s @@ -1,92 +1,47 @@ # REQUIRES: x86 # RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o -# RUN: echo "LIBSAMPLE_2.0 { \ -# RUN: global: \ -# RUN: extern "C++" { \ -# RUN: ab[c]*; \ -# RUN: }; \ -# RUN: }; " > %t.script +# RUN: echo "FOO { global: extern \"C++\" { ab[c]*; }; };" > %t.script # RUN: ld.lld --version-script %t.script -shared %t.o -o %t.so # RUN: llvm-readobj -V %t.so | FileCheck %s --check-prefix=ABC # ABC: Name: _Z3abbi@ -# ABC: Name: _Z3abci@@LIBSAMPLE_2.0 +# ABC: Name: _Z3abci@@FOO -# RUN: echo "LIBSAMPLE_2.0 { \ -# RUN: global: \ -# RUN: extern "C++" { \ -# RUN: ab[b]*; \ -# RUN: }; \ -# RUN: }; " > %t1.script +# RUN: echo "FOO { global: extern \"C++\" { ab[b]*; }; };" > %t1.script # RUN: ld.lld --version-script %t1.script -shared %t.o -o %t1.so # RUN: llvm-readobj -V %t1.so | FileCheck %s --check-prefix=ABB -# ABB: Name: _Z3abbi@@LIBSAMPLE_2.0 +# ABB: Name: _Z3abbi@@FOO # ABB: Name: _Z3abci@ -# RUN: echo "LIBSAMPLE_2.0 { \ -# RUN: global: \ -# RUN: extern "C++" { \ -# RUN: ab[a-b]*; \ -# RUN: }; \ -# RUN: }; " > %t2.script +# RUN: echo "FOO { global: extern \"C++\" { ab[a-b]*; }; };" > %t2.script # RUN: ld.lld --version-script %t2.script -shared %t.o -o %t2.so # RUN: llvm-readobj -V %t2.so | FileCheck %s --check-prefix=ABB -# RUN: echo "LIBSAMPLE_2.0 { \ -# RUN: global: \ -# RUN: extern "C++" { \ -# RUN: ab[a-c]*; \ -# RUN: }; \ -# RUN: }; " > %t3.script +# RUN: echo "FOO { global: extern \"C++\" { ab[a-c]*; }; };" > %t3.script # RUN: ld.lld --version-script %t3.script -shared %t.o -o %t3.so # RUN: llvm-readobj -V %t3.so | FileCheck %s --check-prefix=ABBABC -# ABBABC: Name: _Z3abbi@@LIBSAMPLE_2.0 -# ABBABC: Name: _Z3abci@@LIBSAMPLE_2.0 +# ABBABC: Name: _Z3abbi@@FOO +# ABBABC: Name: _Z3abci@@FOO -# RUN: echo "LIBSAMPLE_2.0 { \ -# RUN: global: \ -# RUN: extern "C++" { \ -# RUN: ab[a-bc-d]*; \ -# RUN: }; \ -# RUN: }; " > %t4.script +# RUN: echo "FOO { global: extern \"C++\" { ab[a-bc-d]*; }; };" > %t4.script # RUN: ld.lld --version-script %t4.script -shared %t.o -o %t4.so # RUN: llvm-readobj -V %t4.so | FileCheck %s --check-prefix=ABBABC -# RUN: echo "LIBSAMPLE_2.0 { \ -# RUN: global: \ -# RUN: extern "C++" { \ -# RUN: ab[a-bd-e]*; \ -# RUN: }; \ -# RUN: }; " > %t5.script +# RUN: echo "FOO { global: extern \"C++\" { ab[a-bd-e]*; }; };" > %t5.script # RUN: ld.lld --version-script %t5.script -shared %t.o -o %t5.so # RUN: llvm-readobj -V %t5.so | FileCheck %s --check-prefix=ABB -# RUN: echo "LIBSAMPLE_2.0 { \ -# RUN: global: \ -# RUN: extern "C++" { \ -# RUN: ab[^a-c]*; \ -# RUN: }; \ -# RUN: }; " > %t6.script +# RUN: echo "FOO { global: extern \"C++\" { ab[^a-c]*; }; };" > %t6.script # RUN: ld.lld --version-script %t6.script -shared %t.o -o %t6.so # RUN: llvm-readobj -V %t6.so | FileCheck %s --check-prefix=NO # NO: Name: _Z3abbi@ # NO: Name: _Z3abci@ -# RUN: echo "LIBSAMPLE_2.0 { \ -# RUN: global: \ -# RUN: extern "C++" { \ -# RUN: ab[^c-z]*; \ -# RUN: }; \ -# RUN: }; " > %t7.script +# RUN: echo "FOO { global: extern \"C++\" { ab[^c-z]*; }; };" > %t7.script # RUN: ld.lld --version-script %t7.script -shared %t.o -o %t7.so # RUN: llvm-readobj -V %t7.so | FileCheck %s --check-prefix=ABB -# RUN: echo "LIBSAMPLE_2.0 { \ -# RUN: global: \ -# RUN: extern "C++" { \ -# RUN: a[x-za-b][a-c]*; \ -# RUN: }; \ -# RUN: }; " > %t8.script +# RUN: echo "FOO { global: extern \"C++\" { a[x-za-b][a-c]*; }; };" > %t8.script # RUN: ld.lld --version-script %t8.script -shared %t.o -o %t8.so # RUN: llvm-readobj -V %t8.so | FileCheck %s --check-prefix=ABBABC diff --git a/lld/test/ELF/version-script-extern-wildcards.s b/lld/test/ELF/version-script-extern-wildcards.s index 838f6379122e..472fc1f7833e 100644 --- a/lld/test/ELF/version-script-extern-wildcards.s +++ b/lld/test/ELF/version-script-extern-wildcards.s @@ -1,27 +1,16 @@ # 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*; \ -# RUN: }; \ -# RUN: }; \ -# RUN: LIBSAMPLE_2.0 { \ -# RUN: global: \ -# RUN: extern \"C++\" { \ -# RUN: zed*; \ -# RUN: bar; \ -# RUN: }; \ -# RUN: }; " > %t.script +# RUN: echo "FOO { global: extern \"C++\" { foo*; }; };" > %t.script +# RUN: echo "BAR { global: extern \"C++\" { zed*; bar; }; };" >> %t.script # RUN: ld.lld --version-script %t.script -shared %t.o -o %t.so # RUN: llvm-readobj -V -dyn-symbols %t.so | FileCheck %s # CHECK: Version symbols { # CHECK: Symbols [ # CHECK: Name: _Z3bari@ -# CHECK: Name: _Z3fooi@@LIBSAMPLE_1.0 -# CHECK: Name: _Z3zedi@@LIBSAMPLE_2.0 +# CHECK: Name: _Z3fooi@@FOO +# CHECK: Name: _Z3zedi@@BAR .text .globl _Z3fooi diff --git a/lld/test/ELF/version-script-noundef.s b/lld/test/ELF/version-script-noundef.s index 4a251d6172da..6a53c74a96bf 100644 --- a/lld/test/ELF/version-script-noundef.s +++ b/lld/test/ELF/version-script-noundef.s @@ -1,16 +1,12 @@ # REQUIRES: x86 -# RUN: echo "VERSION_1.0{ \ -# RUN: global: bar; \ -# RUN: };" > %t.script +# RUN: echo "VERSION_1.0 { global: bar; };" > %t.script # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o # RUN: not ld.lld --version-script %t.script -shared --no-undefined-version \ # RUN: %t.o -o %t.so 2>&1 | FileCheck -check-prefix=ERR1 %s # ERR1: version script assignment of VERSION_1.0 to symbol bar failed: symbol not defined -# RUN: echo "VERSION_1.0{ \ -# RUN: global: und; \ -# RUN: };" > %t2.script +# RUN: echo "VERSION_1.0 { global: und; };" > %t2.script # RUN: not ld.lld --version-script %t2.script -shared --no-undefined-version \ # RUN: %t.o -o %t.so 2>&1 | FileCheck -check-prefix=ERR2 %s # ERR2: version script assignment of VERSION_1.0 to symbol und failed: symbol not defined diff --git a/lld/test/ELF/version-script.s b/lld/test/ELF/version-script.s index fc6e6df2c939..4fe49d0e3910 100644 --- a/lld/test/ELF/version-script.s +++ b/lld/test/ELF/version-script.s @@ -19,41 +19,25 @@ # RUN: ld.lld --version-script %t.script --dynamic-list %t.list %t.o %t2.so -o %t # RUN: llvm-readobj -dyn-symbols %t | FileCheck --check-prefix=EXE %s -# RUN: echo "VERSION_1.0{ \ -# RUN: global: foo1; \ -# RUN: local: *; }; \ -# RUN: VERSION_2.0{ \ -# RUN: global: foo3; \ -# RUN: local: *; }; " > %t4.script +# RUN: echo "VERSION_1.0 { global: foo1; local: *; };" > %t4.script +# RUN: echo "VERSION_2.0 { global: foo3; local: *; };" >> %t4.script # RUN: ld.lld --version-script %t4.script -shared %t.o %t2.so -o %t4.so # RUN: llvm-readobj -dyn-symbols %t4.so | FileCheck --check-prefix=VERDSO %s -# RUN: echo "VERSION_1.0{ \ -# RUN: global: foo1; \ -# RUN: local: *; }; \ -# RUN: { \ -# RUN: global: foo3; \ -# RUN: local: *; }; " > %t5.script +# RUN: echo "VERSION_1.0 { global: foo1; local: *; };" > %t5.script +# RUN: echo "{ global: foo3; local: *; };" >> %t5.script # RUN: not ld.lld --version-script %t5.script -shared %t.o %t2.so -o %t5.so 2>&1 | \ # RUN: FileCheck -check-prefix=ERR1 %s # ERR1: anonymous version definition is used in combination with other version definitions -# RUN: echo "{ \ -# RUN: global: foo1; \ -# RUN: local: *; }; \ -# RUN: VERSION_2.0 { \ -# RUN: global: foo3; \ -# RUN: local: *; }; " > %t5.script +# RUN: echo "{ global: foo1; local: *; };" > %t5.script +# RUN: echo "VERSION_2.0 { global: foo3; local: *; };" >> %t5.script # RUN: not ld.lld --version-script %t5.script -shared %t.o %t2.so -o %t5.so 2>&1 | \ # RUN: FileCheck -check-prefix=ERR2 %s # ERR2: EOF expected, but got VERSION_2.0 -# RUN: echo "VERSION_1.0{ \ -# RUN: global: foo1; \ -# RUN: local: *; }; \ -# RUN: VERSION_2.0 { \ -# RUN: global: foo1; \ -# RUN: local: *; }; " > %t6.script +# RUN: echo "VERSION_1.0 { global: foo1; local: *; };" > %t6.script +# RUN: echo "VERSION_2.0 { global: foo1; local: *; };" >> %t6.script # RUN: ld.lld --version-script %t6.script -shared %t.o %t2.so -o %t6.so 2>&1 | \ # RUN: FileCheck -check-prefix=WARN2 %s # WARN2: duplicate symbol foo1 in version script diff --git a/lld/test/ELF/version-wildcard.test b/lld/test/ELF/version-wildcard.test index 80cb9cadf159..ac0b7edc6c51 100644 --- a/lld/test/ELF/version-wildcard.test +++ b/lld/test/ELF/version-wildcard.test @@ -1,9 +1,7 @@ # REQUIRES: x86 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o -# RUN: echo "VERSION_1.0{ \ -# RUN: global: foo*; \ -# RUN: local: *; };" > %t.script +# RUN: echo "VERSION_1.0 { global: foo*; local: *; };" > %t.script # RUN: ld.lld --version-script %t.script -shared %t.o -o %t.so # RUN: llvm-readobj -dyn-symbols %t.so | FileCheck %s @@ -47,12 +45,8 @@ # CHECK-NEXT: ] # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o -# RUN: echo "VERSION_1.0{ \ -# RUN: global: foo2; \ -# RUN: local: *; }; \ -# RUN: VERSION_2.0{ \ -# RUN: global: foo*; \ -# RUN: }; " > %t2.script +# RUN: echo "VERSION_1.0 { global: foo2; local: *; };" > %t2.script +# RUN: echo "VERSION_2.0 { global: foo*; };" >> %t2.script # RUN: ld.lld --version-script %t2.script -shared %t.o -o %t2.so # RUN: llvm-readobj -dyn-symbols %t2.so | FileCheck --check-prefix=MIX %s