[LLD][COFF] Fix TypeServerSource matcher with more than one collision
[llvm-project.git] / lld / test / COFF / reloc-x64-add32.s
blobf2638332848076158e9e4b8300e720d4c1b6ac29
1 # REQUIRES: x86
2 # RUN: llvm-mc %s -filetype=obj -o %t.obj -triple=x86_64-windows-msvc
3 # RUN: lld-link /entry:main /out:%t.exe /LARGEADDRESSAWARE:NO %t.obj
4 # RUN: llvm-readobj --coff-basereloc %t.exe | FileCheck %s --check-prefix=CHECKPASS
6 # This test case checks that the "ADDR32" relocation symbol is collected
7 # when linking a 64bit executable, and the output contains the HIGHLOW
8 # relocated symbol.
10 # Check that the HIGHLOW relocation base type is in the generated executable
11 # CHECKPASS: Format: COFF-x86-64
12 # CHECKPASS: Arch: x86_64
13 # CHECKPASS: AddressSize: 64bit
14 # CHECKPASS: BaseReloc
15 # CHECKPASS: Entry {
16 # CHECKPASS-NEXT: Type: HIGHLOW
18 .text
19 .def main;
20 .scl 2;
21 .type 32;
22 .endef
23 .intel_syntax noprefix
24 .globl main
25 .p2align 4, 0x90
27 main: # @main
28 sub rsp, 40
30 mov dword ptr [rip + arr + 24], 7
32 mov eax, 1
33 mov ecx, 20
34 mov eax, dword ptr [rcx + 4 * rax + arr]
36 ret
38 .globl arr
39 .p2align 4
40 arr:
41 .zero 40