Home | History | Annotate | Download | only in X86
      1 // RUN: llvm-mc -triple i686-windows -filetype obj -o %t.obj %s
      2 // RUN: llvm-rtdyld -triple i686-windows -dummy-extern _OutputDebugStringA@4=0xfffffffe -dummy-extern _ExitProcess@4=0xffffffff -verify -check=%s %t.obj
      3 
      4 	.text
      5 
      6 	.def _main
      7 		.scl 2
      8 		.type 32
      9 	.endef
     10 	.global _main
     11 _main:
     12 rel1:
     13 	call _function				// IMAGE_REL_I386_REL32
     14 # rtdyld-check: decode_operand(rel1, 0) = (_function-_main-4-1)
     15 	xorl %eax, %eax
     16 	retl
     17 
     18 	.def _function
     19 		.scl 2
     20 		.type 32
     21 	.endef
     22 _function:
     23 rel2:
     24 	pushl string
     25 rel3:
     26 	calll *__imp__OutputDebugStringA	// IMAGE_REL_I386_DIR32
     27 # rtdyld-check: decode_operand(rel3, 3) = __imp__OutputDebugStringA
     28 	addl  $4, %esp
     29 	pushl $0
     30 rel4:
     31 	calll *__imp__ExitProcess		// IMAGE_REL_I386_DIR32
     32 # rtdyld-check: decode_operand(rel4, 3) = __imp__ExitProcess
     33 	addl  $4, %esp
     34 	retl
     35 
     36 	.data
     37 
     38 	.global __imp__OutputDebugStringA
     39 	.align 4
     40 __imp__OutputDebugStringA:
     41 	.long "_OutputDebugStringA@4"		// IMAGE_REL_I386_DIR32
     42 # rtdyld-check: *{4}__imp__OutputDebugStringA = 0xfffffffe
     43 
     44 	.global __imp__ExitProcess
     45 	.align 4
     46 __imp__ExitProcess:
     47 	.long "_ExitProcess@4"			// IMAGE_REL_I386_DIR32
     48 # rtdyld-check: *{4}__imp__ExitProcess = 0xffffffff
     49 
     50 	.global string
     51 	.align 1
     52 string:
     53 	.asciz "Hello World!\n"
     54 
     55 	.global relocations
     56 relocations:
     57 rel5:
     58 	.long _function@imgrel			// IMAGE_REL_I386_DIR32NB
     59 # rtdyld-check: *{4}rel5 = _function - section_addr(COFF_i386.s.tmp.obj, .text)
     60 rel6:
     61 # rtdyld-check: *{2}rel6 = 1
     62 	.secidx __imp__OutputDebugStringA	// IMAGE_REL_I386_SECTION
     63 rel7:
     64 # rtdyld-check: *{4}rel7 = relocations - section_addr(COFF_i386.s.tmp.obj, .data)
     65 	.secrel32 relocations			// IMAGE_REL_I386_SECREL
     66 
     67