[JITLink][arm64] Support arm64e JIT'd code (initially enabled for MachO only).
[llvm-project.git] / lld / test / COFF / weak-antidep.test
blob691aa8f184337b64886844c06924244152fcda93
1 REQUIRES: x86
2 RUN: split-file %s %t.dir && cd %t.dir
4 RUN: llvm-mc -filetype=obj -triple=x86_64-windows antidep.s -o antidep.obj
5 RUN: llvm-mc -filetype=obj -triple=x86_64-windows antidep2.s -o antidep2.obj
6 RUN: llvm-mc -filetype=obj -triple=x86_64-windows weak.s -o weak.obj
7 RUN: llvm-mc -filetype=obj -triple=x86_64-windows test.s -o test.obj
9 Check that a regular weak alias overrides an anti-dependency symbol.
11 RUN: lld-link -dll -noentry -out:out1.dll antidep.obj weak.obj test.obj
12 RUN: llvm-readobj --hex-dump=.test out1.dll | FileCheck --check-prefix=CHECK2 %s
14 RUN: lld-link -dll -noentry -out:out2.dll weak.obj antidep.obj test.obj
15 RUN: llvm-readobj --hex-dump=.test out2.dll | FileCheck --check-prefix=CHECK2 %s
17 RUN: lld-link -dll -noentry -out:out3.dll antidep.obj weak.obj test.obj -lld-allow-duplicate-weak
18 RUN: llvm-readobj --hex-dump=.test out3.dll | FileCheck --check-prefix=CHECK2 %s
20 RUN: lld-link -dll -noentry -out:out4.dll weak.obj antidep.obj test.obj -lld-allow-duplicate-weak
21 RUN: llvm-readobj --hex-dump=.test out4.dll | FileCheck --check-prefix=CHECK2 %s
23 When an anti-dependency symbol is duplicated, the first definition takes precedence over subsequent ones.
25 RUN: lld-link -dll -noentry -out:out5.dll antidep.obj antidep2.obj test.obj
26 RUN: llvm-readobj --hex-dump=.test out5.dll | FileCheck --check-prefix=CHECK1 %s
28 RUN: lld-link -dll -noentry -out:out6.dll antidep2.obj antidep.obj test.obj
29 RUN: llvm-readobj --hex-dump=.test out6.dll | FileCheck --check-prefix=CHECK2 %s
31 CHECK1: 01000000
32 CHECK2: 02000000
34 #--- antidep.s
35      .weak_anti_dep sym
36 .set sym,target1
38 #--- antidep2.s
39      .weak_anti_dep sym
40 .set sym,target2
42 #--- weak.s
43      .weak sym
44 .set sym,target2
46 #--- test.s
47      .section .target,"dr"
48      .globl target1
49 .set target1,1
50      .globl target2
51 .set target2,2
53      .section .test,"dr"
54      .long sym