Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lld / test / ELF / version-script-complex-wildcards.s
blobc58fb54bcb072a0ce4e02349481efe7f054b1aec
1 # REQUIRES: x86
3 # RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
4 # RUN: echo "FOO { global: extern \"C++\" { ab[c]*; }; };" > %t.script
5 # RUN: ld.lld --version-script %t.script -shared %t.o -o %t.so
6 # RUN: llvm-readobj -V %t.so | FileCheck %s --check-prefix=ABC
7 # ABC: Name: _Z3abbi
8 # ABC: Name: _Z3abci@@FOO
10 # RUN: echo "FOO { global: extern \"C++\" { ab[b]*; }; };" > %t1.script
11 # RUN: ld.lld --version-script %t1.script -shared %t.o -o %t1.so
12 # RUN: llvm-readobj -V %t1.so | FileCheck %s --check-prefix=ABB
13 # ABB: Name: _Z3abbi@@FOO
14 # ABB: Name: _Z3abci
16 # RUN: echo "FOO { global: extern \"C++\" { ab[a-b]*; }; };" > %t2.script
17 # RUN: ld.lld --version-script %t2.script -shared %t.o -o %t2.so
18 # RUN: llvm-readobj -V %t2.so | FileCheck %s --check-prefix=ABB
20 # RUN: echo "FOO { global: extern \"C++\" { ab[a-c]*; }; };" > %t3.script
21 # RUN: ld.lld --version-script %t3.script -shared %t.o -o %t3.so
22 # RUN: llvm-readobj -V %t3.so | FileCheck %s --check-prefix=ABBABC
23 # ABBABC: Name: _Z3abbi@@FOO
24 # ABBABC: Name: _Z3abci@@FOO
26 # RUN: echo "FOO { global: extern \"C++\" { ab[a-bc-d]*; }; };" > %t4.script
27 # RUN: ld.lld --version-script %t4.script -shared %t.o -o %t4.so
28 # RUN: llvm-readobj -V %t4.so | FileCheck %s --check-prefix=ABBABC
30 # RUN: echo "FOO { global: extern \"C++\" { ab[a-bd-e]*; }; };" > %t5.script
31 # RUN: ld.lld --version-script %t5.script -shared %t.o -o %t5.so
32 # RUN: llvm-readobj -V %t5.so | FileCheck %s --check-prefix=ABB
34 # RUN: echo "FOO { global: extern \"C++\" { ab[^a-c]*; }; };" > %t6.script
35 # RUN: ld.lld --version-script %t6.script -shared %t.o -o %t6.so
36 # RUN: llvm-readobj -V %t6.so | FileCheck %s --check-prefix=NO
37 # NO: Name: _Z3abbi
38 # NO: Name: _Z3abci
40 # RUN: echo "FOO { global: extern \"C++\" { ab[^c-z]*; }; };" > %t7.script
41 # RUN: ld.lld --version-script %t7.script -shared %t.o -o %t7.so
42 # RUN: llvm-readobj -V %t7.so | FileCheck %s --check-prefix=ABB
44 # RUN: echo "FOO { global: extern \"C++\" { a[x-za-b][a-c]*; }; };" > %t8.script
45 # RUN: ld.lld --version-script %t8.script -shared %t.o -o %t8.so
46 # RUN: llvm-readobj -V %t8.so | FileCheck %s --check-prefix=ABBABC
48 # RUN: echo "FOO { global: extern \"C++\" { a[; }; };" > %t9.script
49 # RUN: not ld.lld --version-script %t9.script -shared %t.o -o /dev/null 2>&1 \
50 # RUN: | FileCheck %s --check-prefix=ERROR
51 # ERROR: invalid glob pattern, unmatched '[': a[
53 .text
54 .globl _Z3abbi
55 .type _Z3abbi,@function
56 _Z3abbi:
57 retq
59 .globl _Z3abci
60 .type _Z3abci,@function
61 _Z3abci:
62 retq