// COFF Image-relative relocations
//
// Test that we produce image-relative when accessing foo@imgrel.
// RUN: llvm-mc -filetype=obj -triple i686-pc-win32 %s > %t.w32.obj
// RUN: llvm-readobj -r %t.w32.obj | FileCheck --check-prefix=W32 %s
// RUN: llvm-objdump -s %t.w32.obj | FileCheck --check-prefix=W32OBJ %s
// RUN: llvm-mc -filetype=obj -triple x86_64-pc-win32 %s > %t.w64.obj
// RUN: llvm-readobj -r %t.w64.obj | FileCheck --check-prefix=W64 %s
// RUN: llvm-objdump -s %t.w64.obj | FileCheck --check-prefix=W64OBJ %s
.data
foo:
.long 1
.long .Llabel@imgrel
.rva .Llabel, .Llabel + 16, foo, .Lother - 3
.text
.Llabel:
mov foo@ , %eax
.Lother:
mov foo@ , %eax
// W32: Relocations
// W32OBJ: Contents of section .data:
// W32OBJ-NEXT: 0000 01000000 00000000 00000000 10000000
// W32OBJ-NEXT: 0010 00000000 fdffffff
// W64: Relocations
// W64OBJ: Contents of section .data:
// W64OBJ-NEXT: 0000 01000000 00000000 00000000 10000000
// W64OBJ-NEXT: 0010 00000000 05000000