[clang-tidy][use-internal-linkage]fix false positives for global overloaded operator...
[llvm-project.git] / lld / test / COFF / weak-antidep-chain.test
blobf6e32c5139a41ec8527c575b711343455877d5de
1 REQUIRES: x86
2 RUN: split-file %s %t.dir && cd %t.dir
4 RUN: llvm-mc -filetype=obj -triple=x86_64-windows chain-bad.s -o chain-bad.obj
5 RUN: llvm-mc -filetype=obj -triple=x86_64-windows chain-bad2.s -o chain-bad2.obj
6 RUN: llvm-mc -filetype=obj -triple=x86_64-windows globals-bad.s -o globals-bad.obj
7 RUN: llvm-mc -filetype=obj -triple=x86_64-windows chain-good.s -o chain-good.obj
8 RUN: llvm-mc -filetype=obj -triple=x86_64-windows chain-good2.s -o chain-good2.obj
9 RUN: llvm-mc -filetype=obj -triple=x86_64-windows globals-good.s -o globals-good.obj
11 Temporary anti-dependency chains are allowed as long as they are broken by non-alias symbols.
13 RUN: lld-link -machine:amd64 -dll -noentry -out:test.dll chain-good.obj globals-good.obj
14 RUN: lld-link -machine:amd64 -dll -noentry -out:test.dll chain-good2.obj globals-good.obj
16 Chaining of anti-dependency symbols is not allowed.
18 RUN: not lld-link -machine:amd64 -dll -noentry -out:test.dll chain-bad.obj globals-bad.obj 2>&1 \
19 RUN:              | FileCheck -check-prefix=ANTIDEP %s
20 RUN: not lld-link -machine:amd64 -dll -noentry -out:test.dll chain-bad2.obj globals-bad.obj 2>&1 \
21 RUN:              | FileCheck -check-prefix=ANTIDEP %s
23 ANTIDEP:      lld-link: error: undefined symbol: sym
24 ANTIDEP-NEXT: >>> referenced by chain-bad
26 #--- chain-bad.s
27     .weak_anti_dep sym
28 .set sym,sym2
29     .weak_anti_dep sym2
30 .set sym2,sym3
32 #--- chain-bad2.s
33     .weak_anti_dep sym2
34 .set sym2,sym3
35     .weak sym
36 .set sym,sym2
38 #--- globals-bad.s
39     .section .test,"r"
40     .global sym3
41 .set sym3,3
43 #--- chain-good.s
44     .weak_anti_dep sym
45 .set sym,sym2
46     .weak_anti_dep sym2
47 .set sym2,sym3
48     .weak_anti_dep sym3
49 .set sym3,sym4
50     .weak_anti_dep sym4
52 #--- chain-good2.s
53     .weak_anti_dep sym
54 .set sym,sym2
55     .weak_anti_dep sym2
56 .set sym2,sym3
57     .weak_anti_dep sym3
58 .set sym3,weak_sym
59     .weak weak_sym
60 .set weak_sym,sym4
61     .weak_anti_dep sym4
63 #--- globals-good.s
64     .section .test,"r"
65     .global sym2
66 .set sym2,2
67     .global sym4
68 .set sym4,4