[PATCH] [mips] Add RuntimeDyld tests for currently supported O32 relocations.

Daniel Sanders daniel.sanders at imgtec.com
Fri May 29 09:13:10 PDT 2015


Hi petarj,

http://reviews.llvm.org/D10126

Files:
  test/ExecutionEngine/RuntimeDyld/Mips/ELF_O32_PIC_relocations.s

Index: test/ExecutionEngine/RuntimeDyld/Mips/ELF_O32_PIC_relocations.s
===================================================================
--- /dev/null
+++ test/ExecutionEngine/RuntimeDyld/Mips/ELF_O32_PIC_relocations.s
@@ -0,0 +1,44 @@
+# RUN: llvm-mc -triple=mipsel-unknown-linux -relocation-model=pic -code-model=small -filetype=obj -o %T/test_ELF_O32.o %s
+# RUN: llc -mtriple=mipsel-unknown-linux -relocation-model=pic -filetype=obj -o %T/test_ELF_ExternalFunction_O32.o %S/Inputs/ExternalFunction.ll
+# RUN: llvm-rtdyld -triple=mipsel-unknown-linux -verify -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
+
+# R!N: llvm-mc -triple=mips-unknown-linux -relocation-model=pic -code-model=small -filetype=obj -o %T/test_ELF_O32.o %s
+# R!N: llc -mtriple=mips-unknown-linux -relocation-model=pic -filetype=obj -o %T/test_ELF_ExternalFunction_O32.o %S/Inputs/ExternalFunction.ll
+# R!N: llvm-rtdyld -triple=mips-unknown-linux -verify -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
+
+        .data
+# rtdyld-check: *{4}R_MIPS_32 = foo
+R_MIPS_32:
+        .word foo
+# rtdyld-check: *{4}(R_MIPS_32+4) = foo
+        .4byte foo
+
+	.text
+	.abicalls
+	.nan	legacy
+	.text
+	.set	nomicromips
+	.set	nomips16
+	.set	noreorder
+	.set	nomacro
+	.set	noat
+
+	.align	3
+	.globl	bar
+	.type	bar, at function
+bar:
+# rtdyld-check:  decode_operand(R_MIPS_26, 0)[27:0] = stub_addr(test_ELF_O32.o, .text, foo)[27:0]
+# rtdyld-check:  decode_operand(R_MIPS_26, 0)[1:0] = 0
+R_MIPS_26:
+	j   foo
+	nop
+
+# rtdyld-check:  decode_operand(R_MIPS_HI16, 1)[15:0] = foo[31:16]
+R_MIPS_HI16:
+	lui	$1, %hi(foo)
+
+# rtdyld-check:  decode_operand(R_MIPS_LO16, 1)[15:0] = foo[15:0]
+R_MIPS_LO16:
+	lui	$1, %lo(foo)
+
+	.size	bar, .-bar

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D10126.26786.patch
Type: text/x-patch
Size: 1946 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150529/8ccc1061/attachment.bin>


More information about the llvm-commits mailing list