1# REQUIRES: x86 2 3# RUN: echo -e "EXPORTS\nvariable1 DATA\nvariable2 DATA" > %t-lib.def 4# RUN: llvm-dlltool -m i386:x86-64 -d %t-lib.def -D lib.dll -l %t-lib.lib 5 6# RUN: llvm-mc -triple=x86_64-windows-gnu %s -filetype=obj -o %t.obj 7# RUN: lld-link -lldmingw -out:%t.exe -entry:main %t.obj %t-lib.lib -verbose 2>&1 | FileCheck %s 8 9# CHECK-NOT: runtime pseudo relocation {{.*}} against symbol variable1 10# CHECK: warning: runtime pseudo relocation in {{.*}}.obj against symbol variable2 is too narrow (only 32 bits wide); this can fail at runtime depending on memory layout 11# CHECK-NOT: runtime pseudo relocation {{.*}} against symbol variable1 12 13 .global main 14 .text 15main: 16 movq .refptr.variable1(%rip), %rax 17 movl (%rax), %eax 18 movl variable2(%rip), %ecx 19 addl %ecx, %eax 20 ret 21 .global _pei386_runtime_relocator 22_pei386_runtime_relocator: 23 ret 24 25 .section .rdata$.refptr.variable1,"dr",discard,.refptr.variable1 26 .global .refptr.variable1 27.refptr.variable1: 28 .quad variable1 29 30relocs: 31 .quad __RUNTIME_PSEUDO_RELOC_LIST__ 32 .quad __RUNTIME_PSEUDO_RELOC_LIST_END__ 33