llvm-project
41 строка · 1013.0 Байт
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
5
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.
9
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
17
18.text
19.def main;
20.scl 2;
21.type 32;
22.endef
23.intel_syntax noprefix
24.globl main
25.p2align 4, 0x90
26
27main: # @main
28sub rsp, 40
29
30mov dword ptr [rip + arr + 24], 7
31
32mov eax, 1
33mov ecx, 20
34mov eax, dword ptr [rcx + 4 * rax + arr]
35
36ret
37
38.globl arr
39.p2align 4
40arr:
41.zero 40
42
43