1 // RUN
: llvm-mc
-triple i686-windows
-filetype obj
-o
%t.obj
%s
2 // RUN
: llvm-rtdyld
-triple i686-windows
-dummy-extern _printf
=0x7ffffffd -dummy-extern _OutputDebugStringA@
4=0x7ffffffe -dummy-extern _ExitProcess@
4=0x7fffffff -verify
-check
=%s
%t.obj
13 call _function
// IMAGE_REL_I386_REL32
14 # rtdyld-check: decode_operand(rel1, 0) = (_function-_main-4-1)
18 # rtdyld-check: decode_operand(rel12, 0)[31:0] = (_printf-_main-4-8)
28 calll
*__imp__OutputDebugStringA
// IMAGE_REL_I386_DIR32
29 # rtdyld-check: decode_operand(rel3, 3) = __imp__OutputDebugStringA
33 calll
*__imp__ExitProcess
// IMAGE_REL_I386_DIR32
34 # rtdyld-check: decode_operand(rel4, 3) = __imp__ExitProcess
40 .global __imp__OutputDebugStringA
42 __imp__OutputDebugStringA
:
43 .long "_OutputDebugStringA@4" // IMAGE_REL_I386_DIR32
44 # rtdyld-check: *{4}__imp__OutputDebugStringA = 0x7ffffffe
46 .global __imp__ExitProcess
49 .long "_ExitProcess@4" // IMAGE_REL_I386_DIR32
50 # rtdyld-check: *{4}__imp__ExitProcess = 0x7fffffff
55 .long _function@imgrel // IMAGE_REL_I386_DIR32NB
56 # rtdyld-check: *{4}rel5 = _function - section_addr(COFF_i386.s.tmp.obj, .text)
58 # rtdyld-check: *{2}rel6 = 1
59 .secidx __imp__OutputDebugStringA // IMAGE_REL_I386_SECTION
61 # rtdyld-check: *{4}rel7 = string - section_addr(COFF_i386.s.tmp.obj, .data)
62 .secrel32 string // IMAGE_REL_I386_SECREL
64 # Test that addends work.
66 # rtdyld-check: *{4}rel8 = string
67 .long string // IMAGE_REL_I386_DIR32
69 # rtdyld-check: *{4}rel9 = string+1
70 .long string+1 // IMAGE_REL_I386_DIR32
72 # rtdyld-check: *{4}rel10 = string - section_addr(COFF_i386.s.tmp.obj, .text) + 1
73 .long string@imgrel+1 // IMAGE_REL_I386_DIR32NB
75 # rtdyld-check: *{4}rel11 = string - section_addr(COFF_i386.s.tmp.obj, .data) + 1
76 .long string@SECREL32+1 // IMAGE_REL_I386_SECREL
78 # We explicitly add padding to put string outside of the 16bit address space
79 # (absolute and as an offset from .data), so that relocations involving
80 # 32bit addresses / offsets are not accidentally truncated to 16 bits.
85 .asciz "Hello World!\n"