Home | History | Annotate | Download | only in Mips
      1 # RUN: llvm-mc -triple=mipsel-unknown-linux -relocation-model=pic -code-model=small -filetype=obj -o %T/test_ELF_O32.o %s
      2 # RUN: llc -mtriple=mipsel-unknown-linux -relocation-model=pic -filetype=obj -o %T/test_ELF_ExternalFunction_O32.o %S/Inputs/ExternalFunction.ll
      3 # RUN: llvm-rtdyld -triple=mipsel-unknown-linux -verify -map-section test_ELF_O32.o,"<common symbols>"=0x7FF8 -map-section test_ELF_O32.o,.text=0x1000 -map-section test_ELF_ExternalFunction_O32.o,.text=0x10000 -check=%s %T/test_ELF_O32.o %T/test_ELF_ExternalFunction_O32.o
      4 
      5 # RUN: llvm-mc -triple=mips-unknown-linux -relocation-model=pic -code-model=small -filetype=obj -o %T/test_ELF_O32.o %s
      6 # RUN: llc -mtriple=mips-unknown-linux -relocation-model=pic -filetype=obj -o %/T/test_ELF_ExternalFunction_O32.o %S/Inputs/ExternalFunction.ll
      7 # RUN: llvm-rtdyld -triple=mips-unknown-linux -verify -map-section test_ELF_O32.o,"<common symbols>"=0x7FF8 -map-section test_ELF_O32.o,.text=0x1000 -map-section test_ELF_ExternalFunction_O32.o,.text=0x10000 -check=%s %T/test_ELF_O32.o %T/test_ELF_ExternalFunction_O32.o
      8 
      9         .data
     10 # rtdyld-check: *{4}R_MIPS_32 = foo[31:0]
     11 R_MIPS_32:
     12         .word foo
     13 # rtdyld-check: *{4}(R_MIPS_32+4) = foo[31:0]
     14         .4byte foo
     15 # rtdyld-check: *{4}(R_MIPS_PC32) = (foo - R_MIPS_PC32)[31:0]
     16 R_MIPS_PC32:
     17         .word foo-.
     18 # rtdyld-check: *{4}(R_MIPS_PC32 + 4) = (foo - tmp1)[31:0]
     19 tmp1:
     20         .4byte foo-tmp1
     21 
     22 	.text
     23 	.abicalls
     24 	.nan	legacy
     25 	.text
     26 	.set	nomicromips
     27 	.set	nomips16
     28 	.set	noreorder
     29 	.set	nomacro
     30 	.set	noat
     31 
     32 	.align	3
     33 	.globl	bar
     34 	.type	bar,@function
     35 bar:
     36 # rtdyld-check:  decode_operand(R_MIPS_26, 0)[27:0] = stub_addr(test_ELF_O32.o, .text, foo)[27:0]
     37 # rtdyld-check:  decode_operand(R_MIPS_26, 0)[1:0] = 0
     38 R_MIPS_26:
     39 	j   foo
     40 	nop
     41 
     42 # rtdyld-check:  decode_operand(R_MIPS_PC16, 1)[17:0] = (foo - R_MIPS_PC16)[17:0]
     43 R_MIPS_PC16:
     44 	bal   foo
     45 	nop
     46 
     47 # rtdyld-check:  decode_operand(R_MIPS_HI16, 1)[15:0] = foo[31:16]
     48 R_MIPS_HI16:
     49 	lui	$1, %hi(foo)
     50 
     51 # rtdyld-check:  decode_operand(R_MIPS_LO16, 1)[15:0] = foo[15:0]
     52 R_MIPS_LO16:
     53 	lui	$1, %lo(foo)
     54 
     55 # rtdyld-check:  decode_operand(R_MIPS_HI16_ADDEND, 1)[15:0] = (var+0x8008)[31:16]
     56 R_MIPS_HI16_ADDEND:
     57 	lui	$2, %hi(var+8)
     58 
     59 # rtdyld-check:  decode_operand(R_MIPS_LO16_ADDEND, 2)[15:0] = (var+0x8)[15:0]
     60 R_MIPS_LO16_ADDEND:
     61 	lb	$2, %lo(var+8)($2)
     62 
     63 	.size	bar, .-bar
     64 	.comm	var,9,1
     65