Imported Upstream version 5.18.0.167

Former-commit-id: 289509151e0fee68a1b591a20c9f109c3c789d3a
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2018-10-20 08:25:10 +00:00
parent e19d552987
commit b084638f15
28489 changed files with 184 additions and 3866856 deletions

View File

@@ -1,47 +0,0 @@
# RUN: llvm-mc -triple=aarch64_be-none-linux-gnu -filetype=obj -o %t %s
# RUN: llvm-rtdyld -triple=aarch64_be-none-linux-gnu -verify -dummy-extern f=0x0123456789abcdef -check=%s %t
.globl Q
.section .dummy, "ax"
Q:
nop
.text
.globl g
.p2align 2
.type g,@function
g:
# R_AARCH64_MOVW_UABS_G3
movz x0, #:abs_g3:f
# R_AARCH64_MOVW_UABS_G2_NC
movk x0, #:abs_g2_nc:f
# R_AARCH64_MOVW_UABS_G1_NC
movk x0, #:abs_g1_nc:f
# R_AARCH64_MOVW_UABS_G0_NC
movk x0, #:abs_g0_nc:f
ret
.Lfunc_end0:
.size g, .Lfunc_end0-g
.type k,@object
.data
.globl k
.p2align 3
k:
.xword f
.size k, 8
r:
# R_AARCH64_PREL32: use Q instead of f to fit in 32 bits.
.word Q - .
# R_AARCH64_PREL64
.p2align 3
.xword f - .
# LE instructions read as BE
# rtdyld-check: *{4}(g) = 0x6024e0d2
# rtdyld-check: *{4}(g + 4) = 0xe0acc8f2
# rtdyld-check: *{4}(g + 8) = 0x6035b1f2
# rtdyld-check: *{4}(g + 12) = 0xe0bd99f2
# rtdyld-check: *{8}k = f
# rtdyld-check: *{4}r = (Q - r)[31:0]
# rtdyld-check: *{8}(r + 8) = f - r - 8

View File

@@ -1,47 +0,0 @@
# RUN: rm -rf %t && mkdir -p %t
# RUN: llvm-mc -triple=arm64-none-linux-gnu -filetype=obj -o %t/pic-reloc.o %s
# RUN: llvm-rtdyld -triple=arm64-none-linux-gnu -verify -check=%s %t/pic-reloc.o \
# RUN: -map-section pic-reloc.o,.got=0x20000 -dummy-extern f=0x1234 -dummy-extern g=0x5678
_s:
nop
_a1:
adrp x8, :got:f
_a2:
adrp x9, :got:g
_a3:
adrp x10, :got:_s
_l1:
ldr x8, [x8, :got_lo12:f]
_l2:
ldr x9, [x9, :got_lo12:g]
_l3:
ldr x10, [x10, :got_lo12:_s]
## We'll end up having two sections .text and .got,
## each is located on the start of a memory page
## Test that .got section has three entries pointing to f, g and _s
# *{8}section_addr(pic-reloc.o, .got) = f
# *{8}(section_addr(pic-reloc.o, .got) + 8) = g
# *{8}(section_addr(pic-reloc.o, .got) + 16) = _s
## Test that first adrp instruction really takes address of
## the .got section (_s label is on the start of a page)
# rtdyld-check: _s + (((*{4}_a1)[30:29] + ((*{4}_a1)[23:5] << 2)) << 12) = section_addr(pic-reloc.o, .got)
## Test that second adrp takes address of .got
# rtdyld-check: _s + (((*{4}_a2)[30:29] + ((*{4}_a2)[23:5] << 2)) << 12) = section_addr(pic-reloc.o, .got)
## Test that third adrp takes address of .got
# rtdyld-check: _s + (((*{4}_a3)[30:29] + ((*{4}_a3)[23:5] << 2)) << 12) = section_addr(pic-reloc.o, .got)
## Test that first ldr immediate value is 0 >> 3 = 0 (1st .got entry)
# rtdyld-check: (*{4}_l1)[21:10] = 0
## Test that second ldr immediate value is 8 >> 3 = 1 (2nd .got entry)
# rtdyld-check: (*{4}_l2)[21:10] = 1
## Test that third ldr immediate value is 16 >> 3 = 2 (3rd .got entry, addend is 0)
# rtdyld-check: (*{4}_l3)[21:10] = 2

View File

@@ -1,14 +0,0 @@
# RUN: llvm-mc -triple=arm64-none-linux-gnu -filetype=obj -o %t %s
# RUN: llvm-rtdyld -triple=arm64-none-linux-gnu -verify -check=%s %t
.globl _main
.weak _label1
.section .text.1,"ax"
_label1:
nop
_main:
b _label1
## Branch 1 instruction back from _main
# rtdyld-check: *{4}(_main) = 0x17ffffff

View File

@@ -1,95 +0,0 @@
# RUN: llvm-mc -triple=arm64-none-linux-gnu -filetype=obj -o %t %s
# RUN: llvm-rtdyld -triple=arm64-none-linux-gnu -verify -dummy-extern f=0x0123456789abcdef -dummy-extern symbol=0xf00f -check=%s %t
.globl Q
.section .dummy, "ax"
Q:
nop
.text
.globl g
.p2align 2
.type g,@function
g:
# R_AARCH64_MOVW_UABS_G3
movz x0, #:abs_g3:f
# R_AARCH64_MOVW_UABS_G2_NC
movk x0, #:abs_g2_nc:f
# R_AARCH64_MOVW_UABS_G1_NC
movk x0, #:abs_g1_nc:f
# R_AARCH64_MOVW_UABS_G0_NC
movk x0, #:abs_g0_nc:f
l:
# R_AARCH64_LDST8_ABS_LO12_NC
ldrsb x4, [x5, :lo12:a+1]
# R_AARCH64_LDST16_ABS_LO12_NC
ldrh w4, [x5, :lo12:a+2]
# R_AARCH64_LDST32_ABS_LO12_NC
ldr s4, [x5, :lo12:a]
# R_AARCH64_LDST64_ABS_LO12_NC
ldr x4, [x5, :lo12:a]
# R_AARCH64_LDST128_ABS_LO12_NC
ldr q4, [x5, :lo12:a]
p:
# R_AARCH64_ADR_PREL_PG_HI21
# Test both low and high immediate values
adrp x4, a + 20480 // 16384 + 4096
# Align next label to 16 bytes, so that LDST immediate
# fields will be non-zero
.align 4
a:
# R_AARCH64_ADD_ABS_LO12_NC
add x0, x0, :lo12:f
ret
.Lfunc_end0:
.size g, .Lfunc_end0-g
.type k,@object
.data
.globl k
.p2align 3
k:
.xword f
.size k, 16
r:
# R_AARCH64_PREL32: use Q instead of f to fit in 32 bits.
.word Q - .
# R_AARCH64_PREL64
.p2align 3
.xword f - .
# rtdyld-check: *{4}(g) = 0xd2e02460
# rtdyld-check: *{4}(g + 4) = 0xf2c8ace0
# rtdyld-check: *{4}(g + 8) = 0xf2b13560
# rtdyld-check: *{4}(g + 12) = 0xf299bde0
## Check LDSTXX_ABS_LO12_NC
# rtdyld-check: (*{4}l)[21:10] = (a+1)[11:0]
# rtdyld-check: (*{4}(l+4))[21:10] = (a+2)[11:1]
# rtdyld-check: (*{4}(l+8))[21:10] = a[11:2]
# rtdyld-check: (*{4}(l+12))[21:10] = a[11:3]
# rtdyld-check: (*{4}(l+16))[21:10] = a[11:4]
## Check ADR_PREL_PG_HI21. Low order bits of immediate value
## go to bits 30:29. High order bits go to bits 23:5
# rtdyld-check: (*{4}p)[30:29] = (a - p + 20480)[13:12]
# rtdyld-check: (*{4}p)[23:5] = (a - p + 20480)[32:14]
# rtdyld-check: *{8}k = f
# rtdyld-check: *{4}r = (Q - r)[31:0]
# rtdyld-check: *{8}(r + 8) = f - r - 8
## f & 0xFFF = 0xdef (bits 11:0 of f)
## 0xdef << 10 = 0x37bc00
# rtdyld-check: *{4}(a) = 0x9137bc00
.data
ABS16:
.short symbol
# rtdyld-check: (*{2}ABS16) = symbol[15:0]
ABS32:
.long symbol
# rtdyld-check: (*{4}ABS32) = symbol[31:0]
ABS64:
.xword symbol
# rtdyld-check: (*{8}ABS64) = symbol

View File

@@ -1,85 +0,0 @@
# RUN: rm -rf %t && mkdir -p %t
# RUN: llvm-mc -triple=arm64-apple-ios7.0.0 -filetype=obj -o %t/foo.o %s
# RUN: llvm-rtdyld -triple=arm64-apple-ios7.0.0 -map-section foo.o,__text=0x10bc0 -verify -check=%s %t/foo.o
.section __TEXT,__text,regular,pure_instructions
.ios_version_min 7, 0
.globl _foo
.align 2
_foo:
movz w0, #0
ret
.globl _test_branch_reloc
.align 2
# Test ARM64_RELOC_BRANCH26 relocation. The branch instruction only encodes 26
# bits of the 28-bit possible branch range. The lower two bits are always zero
# and therefore ignored.
# rtdyld-check: decode_operand(br1, 0)[25:0] = (_foo - br1)[27:2]
_test_branch_reloc:
br1:
b _foo
ret
# Test ARM64_RELOC_PAGE21 and ARM64_RELOC_PAGEOFF12 relocation. adrp encodes
# the PC-relative page (4 KiB) difference between the adrp instruction and the
# variable ptr. ldr encodes the offset of the variable within the page. The ldr
# instruction perfroms an implicit shift on the encoded immediate (imm<<3).
# rtdyld-check: decode_operand(adrp1, 1) = (_ptr[32:12] - adrp1[32:12])
# rtdyld-check: decode_operand(ldr1, 2) = _ptr[11:3]
.globl _test_adrp_ldr
.align 2
_test_adrp_ldr:
adrp1:
adrp x0, _ptr@PAGE
ldr1:
ldr x0, [x0, _ptr@PAGEOFF]
ret
# Test ARM64_RELOC_GOT_LOAD_PAGE21 and ARM64_RELOC_GOT_LOAD_PAGEOFF12
# relocation. adrp encodes the PC-relative page (4 KiB) difference between the
# adrp instruction and the GOT entry for ptr. ldr encodes the offset of the GOT
# entry within the page. The ldr instruction perfroms an implicit shift on the
# encoded immediate (imm<<3).
# rtdyld-check: *{8}(stub_addr(foo.o, __text, _ptr)) = _ptr
# rtdyld-check: decode_operand(adrp2, 1) = (stub_addr(foo.o, __text, _ptr)[32:12] - adrp2[32:12])
# rtdyld-check: decode_operand(ldr2, 2) = stub_addr(foo.o, __text, _ptr)[11:3]
.globl _test_adrp_ldr
.align 2
_test_got_adrp_ldr:
adrp2:
adrp x0, _ptr@GOTPAGE
ldr2:
ldr x0, [x0, _ptr@GOTPAGEOFF]
ret
# rtdyld-check: decode_operand(add1, 2) = (tgt+8)[11:2] << 2
.globl _test_explicit_addend_reloc
.align 4
_test_explicit_addend_reloc:
add1:
add x0, x0, tgt@PAGEOFF+8
.align 3
tgt:
.long 0
.long 0
.long 7
# Test ARM64_RELOC_UNSIGNED relocation. The absolute 64-bit address of the
# function should be stored at the 8-byte memory location.
# rtdyld-check: *{8}_ptr = _foo
.section __DATA,__data
.globl _ptr
.align 3
.fill 4096, 1, 0
_ptr:
.quad _foo
# Test ARM64_RELOC_SUBTRACTOR.
# rtdyld-check: *{8}_subtractor_result = _test_branch_reloc - _foo
_subtractor_result:
.quad _test_branch_reloc - _foo

View File

@@ -1,3 +0,0 @@
if not 'AArch64' in config.root.targets:
config.unsupported = True

View File

@@ -1,149 +0,0 @@
// RUN: llvm-mc -triple thumbv7-windows-itanium -filetype obj -o %t.obj %s
// RUN: llvm-rtdyld -triple thumbv7-windows -dummy-extern OutputDebugStringW=0x01310061 -dummy-extern OutputDebugStringA=0x78563413 -dummy-extern ExitProcess=0x54769891 -dummy-extern unnamed_addr=0x00001024 -verify -check %s %t.obj
.text
.syntax unified
.def unnamed_addr
.scl 2
.type 32
.endef
.global unnamed_addr
.def branch24t
.scl 2
.type 32
.endef
.global branch24t
.p2align 1
.code 16
.thumb_func
branch24t:
@ rel1:
# b unnamed_addr @ IMAGE_REL_ARM_BRANCH24T
.def function
.scl 2
.type 32
.endef
.globl function
.p2align 1
.code 16
.thumb_func
function:
push.w {r11, lr}
mov r11, sp
rel2: @ IMAGE_REL_ARM_MOV32T
movw r0, :lower16:__imp_OutputDebugStringA
# rtdyld-check: decode_operand(rel2, 1) = (__imp_OutputDebugStringA&0x0000ffff)
movt r0, :upper16:__imp_OutputDebugStringA
# TODO rtdyld-check: decode_operand(rel2, 1) = (__imp_OutputDebugStringA&0xffff0000>>16)
ldr r1, [r0]
rel3: @ IMAGE_REL_ARM_MOV32T
movw r0, :lower16:string
# rtdyld-check: decode_operand(rel3, 1) = (string&0x0000ffff)
movt r0, :upper16:string
# TODO rtdyld-check: decode_operand(rel3, 1) = (string&0xffff0000>>16)
blx r1
rel4: @ IMAGE_REL_ARM_MOV32T
movw r0, :lower16:__imp_ExitProcess
# rtdyld-check: decode_operand(rel4, 1) = (__imp_ExitProcess&0x0000ffff)
movt r0, :upper16:__imp_ExitProcess
# TODO rtdyld-check: decode_operand(rel4, 1) = (__imp_ExitProcess&0xffff0000>>16)
ldr r1, [r0]
movs r0, #0
pop.w {r11, lr}
bx r1
.def main
.scl 2
.type 32
.endef
.globl main
.p2align 1
.code 16
.thumb_func
main:
push.w {r11, lr}
mov r11, sp
rel5:
# bl function @ IMAGE_REL_ARM_BLX23T
movs r0, #0
pop.w {r11, pc}
.section .rdata,"dr"
.global string
string:
.asciz "Hello World\n"
.data
.p2align 2
__imp_OutputDebugStringA:
@ rel6:
.long OutputDebugStringA @ IMAGE_REL_ARM_ADDR32
# rtdyld-check: *{4}__imp_OutputDebugStringA = 0x78563413
.p2align 2
__imp_ExitProcess:
@ rel7:
.long ExitProcess @ IMAGE_REL_ARM_ADDR32
# rtdyld-check: *{4}__imp_ExitProcess = 0x54769891
.global relocations
relocations:
@ rel8:
.long function(imgrel) @ IMAGE_REL_ARM_ADDR32NB
# rtdyld-check: *{4}relocations = function - section_addr(COFF_Thumb.s.tmp.obj, .text)
rel9:
.secidx __imp_OutputDebugStringA @ IMAGE_REL_ARM_SECTION
# rtdyld-check: *{2}rel9 = 1
rel10:
.long relocations(secrel32) @ IMAGE_REL_ARM_SECREL
# rtdyld-check: *{4}rel10 = relocations - section_addr(COFF_Thumb.s.tmp.obj, .data)
rel11:
.secrel32 relocations @ IMAGE_REL_ARM_SECREL
# rtdyld-check: *{4}rel11 = relocations - section_addr(COFF_Thumb.s.tmp.obj, .data)
rel12: @ IMAGE_REL_ARM_MOV32T
movw r0, :lower16:__imp_OutputDebugStringW
# rtdyld-check: decode_operand(rel12, 1) = (__imp_OutputDebugStringW&0x0000ffff)
movt r0, :upper16:__imp_OutputDebugStringW
# TODO rtdyld-check: decode_operand(rel12, 1) = (__imp_OutputDebugStringW&0xffff0000>>16)
bx r0
trap
.data
.p2align 2
__imp_OutputDebugStringW:
@ rel13:
.long OutputDebugStringW @ IMAGE_REL_ARM_ADDR32
# rtdyld-check: *{4}__imp_OutputDebugStringW = 0x01310061
.p2align 2
branch_to_thumb_func:
@ rel14: @ IMAGE_REL_ARM_MOV32T
movw r0, :lower16:function
# rtdyld-check: decode_operand(branch_to_thumb_func, 1) = (function&0x0000ffff|1)
movt r0, :upper16:function
# TODO rtdyld-check: decode_operand(branch_to_thumb_func, 1) = (function&0xffff0000>>16)
bx r0
trap
.data
.p2align 2
a_data_symbol:
.long 1073741822
.p2align 2
.text
ref_to_data_symbol_addr:
@ rel15: @ IMAGE_REL_ARM_MOV32T
movw r0, :lower16:a_data_symbol
# rtdyld-check: decode_operand(ref_to_data_symbol_addr, 1) = (a_data_symbol&0x0000ffff)
movt r0, :upper16:a_data_symbol
# TODO rtdyld-check: decode_operand(ref_to_data_symbol_addr, 1) = (a_data_symbol&0xffff0000>>16)

View File

@@ -1,24 +0,0 @@
# RUN: rm -rf %t && mkdir -p %t
# RUN: llvm-mc -triple=arm-linux-gnueabihf -filetype=obj -o %t/reloc.o %s
# RUN: llvm-rtdyld -triple=arm-linux-gnueabihf -verify -map-section reloc.o,.ARM.exidx=0x6000 -map-section reloc.o,.text=0x4000 -dummy-extern __aeabi_unwind_cpp_pr0=0x1234 -check=%s %t/reloc.o
.text
.syntax unified
.eabi_attribute 67, "2.09" @ Tag_conformance
.cpu cortex-a8
.fpu neon
.file "reloc.c"
.globl g
.align 2
.type g,%function
g:
.fnstart
movw r0, #1
bx lr
.Lfunc_end0:
.size g, .Lfunc_end0-g
.fnend
# rtdyld-check: *{4}(section_addr(reloc.o, .ARM.exidx)) = (g - (section_addr(reloc.o, .ARM.exidx))) & 0x7fffffff
# Compat unwind info: finish(0xb0), finish(0xb0), finish(0xb0)
# rtdyld-check: *{4}(section_addr(reloc.o, .ARM.exidx) + 0x4) = 0x80b0b0b0

View File

@@ -1,59 +0,0 @@
# RUN: rm -rf %t && mkdir -p %t
# RUN: llvm-mc -triple=armv7s-apple-ios7.0.0 -filetype=obj -o %t/foo.o %s
# RUN: llvm-rtdyld -triple=armv7s-apple-ios7.0.0 -verify -check=%s %t/foo.o
.syntax unified
.section __TEXT,__text,regular,pure_instructions
.globl bar
.align 2
bar:
# Check lower 16-bits of section difference relocation
# rtdyld-check: decode_operand(insn1, 1) = (foo$non_lazy_ptr-(nextPC+8))[15:0]
insn1:
movw r0, :lower16:(foo$non_lazy_ptr-(nextPC+8))
# Check upper 16-bits of section difference relocation
# rtdyld-check: decode_operand(insn2, 2) = (foo$non_lazy_ptr-(nextPC+8))[31:16]
insn2:
movt r0, :upper16:(foo$non_lazy_ptr-(nextPC+8))
nextPC:
add r1, r0, r0
# Check stub generation for external symbols by referencing a common symbol, 'baz'.
# Check both the content of the stub, and the reference to the stub.
# Stub should contain '0xe51ff004' (ldr pc, [pc, #-4]), followed by the target.
#
# rtdyld-check: *{4}(stub_addr(foo.o, __text, baz)) = 0xe51ff004
# rtdyld-check: *{4}(stub_addr(foo.o, __text, baz) + 4) = baz
#
# rtdyld-check: decode_operand(insn3, 0) = stub_addr(foo.o, __text, baz) - (insn3 + 8)
insn3:
bl baz
# Check stub generation for internal symbols by referencing 'bar'.
# rtdyld-check: *{4}(stub_addr(foo.o, __text, bar) + 4) = bar
insn4:
bl bar
bx lr
# Add 'aaa' to the common symbols to make sure 'baz' isn't at the start of the
# section. This ensures that we test VANILLA relocation addends correctly.
.comm aaa, 4, 2
.comm baz, 4, 2
.comm foo, 4, 2
.section __DATA,__data
.globl _a
.align 2
# rtdyld-check: *{4}bar_ofs = bar + 4
bar_ofs:
.long bar + 4
# Check that the symbol pointer section entries are fixed up properly:
# rtdyld-check: *{4}foo$non_lazy_ptr = foo
.section __DATA,__nl_symbol_ptr,non_lazy_symbol_pointers
.align 2
foo$non_lazy_ptr:
.indirect_symbol foo
.long 0
.subsections_via_symbols

View File

@@ -1,52 +0,0 @@
# RUN: rm -rf %t && mkdir -p %t
# RUN: llvm-mc -triple=thumbv7s-apple-ios7.0.0 -filetype=obj -o %t/MachO_Thumb.o %s
# RUN: llvm-rtdyld -triple=thumbv7s-apple-ios7.0.0 -verify -check=%s %t/MachO_Thumb.o
.section __TEXT,__text,regular,pure_instructions
.syntax unified
# Add 'aaa' to the common symbols to make sure 'baz' isn't at the start of the
# section. This ensures that we test VANILLA relocation addends correctly.
.comm aaa, 4, 2
.comm baz, 4, 2
.globl bar
.p2align 1
.code 16 @ @bar
.thumb_func bar
bar:
# Check lower 16-bits of section difference relocation
# rtdyld-check: decode_operand(insn1, 1) = (foo-(nextPC+8))[15:0]
insn1:
movw r0, :lower16:(foo-(nextPC+8))
# Check upper 16-bits of section difference relocation
# rtdyld-check: decode_operand(insn2, 2) = (foo-(nextPC+8))[31:16]
insn2:
movt r0, :upper16:(foo-(nextPC+8))
nextPC:
nop
# Check stub generation for external symbols by referencing a common symbol, 'baz'.
# Check both the content of the stub, and the reference to the stub.
# Stub should contain '0xf000f8df' (ldr.w pc, [pc]), followed by the target.
#
# rtdyld-check: *{4}(stub_addr(MachO_Thumb.o, __text, baz)) = 0xf000f8df
# rtdyld-check: *{4}(stub_addr(MachO_Thumb.o, __text, baz) + 4) = baz
#
# rtdyld-check: decode_operand(insn3, 0) = stub_addr(MachO_Thumb.o, __text, baz) - (insn3 + 4)
insn3:
bl baz
# Check stub generation for internal symbols by referencing 'bar'.
# rtdyld-check: *{4}(stub_addr(MachO_Thumb.o, __text, bar) + 4) = bar & 0xfffffffffffffffe
insn4:
bl bar
.section __DATA,__data
.align 2
foo:
.long 0
.subsections_via_symbols

View File

@@ -1,3 +0,0 @@
if not 'ARM' in config.root.targets:
config.unsupported = True

View File

@@ -1,171 +0,0 @@
# RUN: rm -rf %t && mkdir -p %t
# RUN: llvm-mc -triple=mips64el-unknown-linux -filetype=obj -o %t/test_ELF_Mips64N64.o %s
# RUN: llc -mtriple=mips64el-unknown-linux -filetype=obj -o %t/test_ELF_ExternalFunction_Mips64N64.o %S/Inputs/ExternalFunction.ll
# RUN: llvm-rtdyld -triple=mips64el-unknown-linux -verify -map-section test_ELF_Mips64N64.o,.text=0x1000 -map-section test_ELF_ExternalFunction_Mips64N64.o,.text=0x10000 -check=%s %t/test_ELF_Mips64N64.o %t/test_ELF_ExternalFunction_Mips64N64.o
# RUN: llvm-mc -triple=mips64-unknown-linux -filetype=obj -o %t/test_ELF_Mips64N64.o %s
# RUN: llc -mtriple=mips64-unknown-linux -filetype=obj -o %t/test_ELF_ExternalFunction_Mips64N64.o %S/Inputs/ExternalFunction.ll
# RUN: llvm-rtdyld -triple=mips64-unknown-linux -verify -map-section test_ELF_Mips64N64.o,.text=0x1000 -map-section test_ELF_ExternalFunction_Mips64N64.o,.text=0x10000 -check=%s %t/test_ELF_Mips64N64.o %t/test_ELF_ExternalFunction_Mips64N64.o
.data
# Test R_MIPS_PC32 relocation.
# rtdyld-check: *{4}(R_MIPS_PC32) = (foo - R_MIPS_PC32)[31:0]
R_MIPS_PC32:
.word foo-.
# rtdyld-check: *{4}(R_MIPS_PC32 + 4) = (foo - tmp1)[31:0]
tmp1:
.4byte foo-tmp1
.text
.abicalls
.section .mdebug.abi64,"",@progbits
.nan legacy
.file "ELF_Mips64N64_PIC_relocations.ll"
.text
.globl bar
.align 3
.type bar,@function
.set nomicromips
.set nomips16
.ent bar
bar:
.frame $fp,40,$ra
.mask 0x00000000,0
.fmask 0x00000000,0
.set noreorder
.set nomacro
.set noat
daddiu $sp, $sp, -40
sd $ra, 32($sp)
sd $fp, 24($sp)
move $fp, $sp
sd $4, 16($fp)
lb $2, 0($4)
sd $4, 8($fp)
# Test R_MIPS_26 relocation.
# rtdyld-check: decode_operand(insn1, 0)[27:0] = stub_addr(test_ELF_Mips64N64.o, .text, foo)[27:0]
insn1:
.option pic0
jal foo
.option pic2
nop
# Test R_MIPS_PC16 relocation.
# rtdyld-check: decode_operand(insn2, 1)[17:0] = (foo - insn2)[17:0]
insn2:
bal foo
nop
move $sp, $fp
ld $ra, 32($sp)
ld $fp, 24($sp)
daddiu $sp, $sp, 32
jr $ra
nop
.set at
.set macro
.set reorder
.end bar
$func_end0:
.size bar, ($func_end0)-bar
.globl main
.align 3
.type main,@function
.set nomicromips
.set nomips16
.ent main
main:
.frame $fp,32,$ra
.mask 0x00000000,0
.fmask 0x00000000,0
.set noreorder
.set nomacro
.set noat
daddiu $sp, $sp, -32
sd $ra, 24($sp)
sd $fp, 16($sp)
sd $gp, 8($sp)
move $fp, $sp
# Check upper 16-bits of offset between the address of main function
# and the global offset table.
# rtdyld-check: decode_operand(insn3, 1)[15:0] = ((section_addr(test_ELF_Mips64N64.o, .got) + 0x7ff0) - main + 0x8000)[31:16]
insn3:
lui $1, %hi(%neg(%gp_rel(main)))
daddu $1, $1, $25
# Check lower 16-bits of offset between the address of main function
# and the global offset table.
# rtdyld-check: decode_operand(insn4, 2)[15:0] = ((section_addr(test_ELF_Mips64N64.o, .got) + 0x7ff0) - main)[15:0]
insn4:
daddiu $1, $1, %lo(%neg(%gp_rel(main)))
sw $zero, 4($fp)
# $gp register contains address of the .got section + 0x7FF0. 0x7FF0 is
# the offset of $gp from the beginning of the .got section. Check that we are
# loading address of the page pointer from correct offset. In this case
# the page pointer is the first entry in the .got section, so offset will be
# 0 - 0x7FF0.
# rtdyld-check: decode_operand(insn5, 2)[15:0] = 0x8010
#
# Check that the global offset table contains the page pointer.
# rtdyld-check: *{8}(section_addr(test_ELF_Mips64N64.o, .got)) = (_str + 0x8000) & 0xffffffffffff0000
insn5:
ld $25, %got_page(_str)($1)
# Check the offset of _str from the page pointer.
# rtdyld-check: decode_operand(insn6, 2)[15:0] = _str[15:0]
insn6:
daddiu $25, $25, %got_ofst(_str)
# Check that we are loading address of var from correct offset. In this case
# var is the second entry in the .got section, so offset will be 8 - 0x7FF0.
# rtdyld-check: decode_operand(insn7, 2)[15:0] = 0x8018
#
# Check that the global offset table contains the address of the var.
# rtdyld-check: *{8}(section_addr(test_ELF_Mips64N64.o, .got) + 8) = var
insn7:
ld $2, %got_disp(var)($1)
sd $25, 0($2)
# Check that we are loading address of bar from correct offset. In this case
# bar is the third entry in the .got section, so offset will be 16 - 0x7FF0.
# rtdyld-check: decode_operand(insn8, 2)[15:0] = 0x8020
#
# Check that the global offset table contains the address of the bar.
# rtdyld-check: *{8}(section_addr(test_ELF_Mips64N64.o, .got) + 16) = bar
insn8:
ld $2, %call16(bar)($1)
move $4, $25
move $gp, $1
move $25, $2
jalr $25
nop
move $sp, $fp
ld $gp, 8($sp)
ld $fp, 16($sp)
ld $ra, 24($sp)
daddiu $sp, $sp, 32
jr $ra
nop
.set at
.set macro
.set reorder
.end main
$func_end1:
.size main, ($func_end1)-main
.type _str,@object
.section .rodata.str1.1,"aMS",@progbits,1
_str:
.asciz "test"
.size _str, 5
.type var,@object
.comm var,8,8
.section ".note.GNU-stack","",@progbits
.text

View File

@@ -1,157 +0,0 @@
# RUN: rm -rf %t && mkdir -p %t
# RUN: llvm-mc -triple=mips64el-unknown-linux -target-abi n32 -filetype=obj -o %t/test_ELF_N32.o %s
# RUN: llc -mtriple=mips64el-unknown-linux -target-abi n32 -filetype=obj -o %t/test_ELF_ExternalFunction_N32.o %S/Inputs/ExternalFunction.ll
# RUN: llvm-rtdyld -triple=mips64el-unknown-linux -verify -map-section test_ELF_N32.o,.text=0x1000 -map-section test_ELF_ExternalFunction_N32.o,.text=0x10000 -check=%s %t/test_ELF_N32.o %t/test_ELF_ExternalFunction_N32.o
# RUN: llvm-mc -triple=mips64-unknown-linux -target-abi n32 -filetype=obj -o %t/test_ELF_N32.o %s
# RUN: llc -mtriple=mips64-unknown-linux -target-abi n32 -filetype=obj -o %t/test_ELF_ExternalFunction_N32.o %S/Inputs/ExternalFunction.ll
# RUN: llvm-rtdyld -triple=mips64-unknown-linux -verify -map-section test_ELF_N32.o,.text=0x1000 -map-section test_ELF_ExternalFunction_N32.o,.text=0x10000 -check=%s %t/test_ELF_N32.o %t/test_ELF_ExternalFunction_N32.o
.data
# Test R_MIPS_PC32 relocation.
# rtdyld-check: *{4}(R_MIPS_PC32) = (foo - R_MIPS_PC32)[31:0]
R_MIPS_PC32:
.word foo-.
# rtdyld-check: *{4}(R_MIPS_PC32 + 4) = (foo - tmp1)[31:0]
tmp1:
.4byte foo-tmp1
.text
.abicalls
.section .mdebug.abi64,"",@progbits
.nan legacy
.file "ELF_N32_PIC_relocations.ll"
.text
.globl bar
.align 3
.type bar,@function
.set nomicromips
.set nomips16
.ent bar
bar:
.frame $fp,40,$ra
.mask 0x00000000,0
.fmask 0x00000000,0
.set noreorder
.set nomacro
.set noat
daddiu $sp, $sp, -40
sd $ra, 32($sp)
sd $fp, 24($sp)
move $fp, $sp
sd $4, 16($fp)
lb $2, 0($4)
sd $4, 8($fp)
# Test R_MIPS_26 relocation.
# rtdyld-check: decode_operand(insn1, 0)[27:0] = stub_addr(test_ELF_N32.o, .text, foo)[27:0]
insn1:
.option pic0
jal foo
.option pic2
nop
# Test R_MIPS_PC16 relocation.
# rtdyld-check: decode_operand(insn2, 1)[17:0] = (foo - insn2)[17:0]
insn2:
bal foo
nop
move $sp, $fp
ld $ra, 32($sp)
ld $fp, 24($sp)
daddiu $sp, $sp, 32
jr $ra
nop
.set at
.set macro
.set reorder
.end bar
$func_end0:
.size bar, ($func_end0)-bar
.globl main
.align 3
.type main,@function
.set nomicromips
.set nomips16
.ent main
main:
.frame $fp,32,$ra
.mask 0x00000000,0
.fmask 0x00000000,0
.set noreorder
.set nomacro
.set noat
daddiu $sp, $sp, -32
sd $ra, 24($sp)
sd $fp, 16($sp)
sd $gp, 8($sp)
move $fp, $sp
# $gp register contains address of the .got section + 0x7FF0. 0x7FF0 is
# the offset of $gp from the beginning of the .got section. Check that we are
# loading address of the page pointer from correct offset. In this case
# the page pointer is the first entry in the .got section, so offset will be
# 0 - 0x7FF0.
# rtdyld-check: decode_operand(insn5, 2)[15:0] = 0x8010
#
# Check that the global offset table contains the page pointer.
# rtdyld-check: *{4}(section_addr(test_ELF_N32.o, .got)) = (_str + 0x8000) & 0xffff0000
insn5:
ld $25, %got_page(_str)($1)
# Check the offset of _str from the page pointer.
# rtdyld-check: decode_operand(insn6, 2)[15:0] = _str[15:0]
insn6:
daddiu $25, $25, %got_ofst(_str)
# Check that we are loading address of var from correct offset. In this case
# var is the second entry in the .got section, so offset will be 4 - 0x7FF0.
# rtdyld-check: decode_operand(insn7, 2)[15:0] = 0x8014
#
# Check that the global offset table contains the address of the var.
# rtdyld-check: *{4}(section_addr(test_ELF_N32.o, .got) + 4) = var
insn7:
ld $2, %got_disp(var)($1)
sd $25, 0($2)
# Check that we are loading address of bar from correct offset. In this case
# bar is the third entry in the .got section, so offset will be 8 - 0x7FF0.
# rtdyld-check: decode_operand(insn8, 2)[15:0] = 0x8018
#
# Check that the global offset table contains the address of the bar.
# rtdyld-check: *{4}(section_addr(test_ELF_N32.o, .got) + 8) = bar
insn8:
ld $2, %call16(bar)($1)
move $4, $25
move $gp, $1
move $25, $2
jalr $25
nop
move $sp, $fp
ld $gp, 8($sp)
ld $fp, 16($sp)
ld $ra, 24($sp)
daddiu $sp, $sp, 32
jr $ra
nop
.set at
.set macro
.set reorder
.end main
$func_end1:
.size main, ($func_end1)-main
.type _str,@object
.section .rodata.str1.1,"aMS",@progbits,1
_str:
.asciz "test"
.size _str, 5
.type var,@object
.comm var,8,8
.section ".note.GNU-stack","",@progbits
.text

View File

@@ -1,55 +0,0 @@
# RUN: rm -rf %t && mkdir -p %t
# RUN: llvm-mc -triple=mips64el-unknown-linux -mcpu=mips64r6 -filetype=obj -o %t/test_ELF_N64R6.o %s
# RUN: llc -mtriple=mips64el-unknown-linux -mcpu=mips64r6 -filetype=obj -o %t/test_ELF_ExternalFunction_N64R6.o %S/Inputs/ExternalFunction.ll
# RUN: llvm-rtdyld -triple=mips64el-unknown-linux -mcpu=mips64r6 -verify -map-section test_ELF_N64R6.o,.text=0x1000 -map-section test_ELF_ExternalFunction_N64R6.o,.text=0x10000 -check=%s %t/test_ELF_N64R6.o %t/test_ELF_ExternalFunction_N64R6.o
# RUN: llvm-mc -triple=mips64-unknown-linux -mcpu=mips64r6 -filetype=obj -o %t/test_ELF_N64R6.o %s
# RUN: llc -mtriple=mips64-unknown-linux -mcpu=mips64r6 -filetype=obj -o %t/test_ELF_ExternalFunction_N64R6.o %S/Inputs/ExternalFunction.ll
# RUN: llvm-rtdyld -triple=mips64-unknown-linux -mcpu=mips64r6 -verify -map-section test_ELF_N64R6.o,.text=0x1000 -map-section test_ELF_ExternalFunction_N64R6.o,.text=0x10000 -check=%s %t/test_ELF_N64R6.o %t/test_ELF_ExternalFunction_N64R6.o
.text
.abicalls
.nan 2008
.text
.set nomicromips
.set nomips16
.set noreorder
.set nomacro
.set noat
.align 3
.globl bar
.type bar,@function
bar:
# Test R_MIPS_PC18_S3 relocation.
# rtdyld-check: decode_operand(R_MIPS_PC18_S3, 1)[20:0] = (foo - R_MIPS_PC18_S3)[20:0]
R_MIPS_PC18_S3:
ldpc $6,foo
# Test R_MIPS_PC19_S2 relocation.
# rtdyld-check: decode_operand(R_MIPS_PC19_S2, 1)[20:0] = (foo - R_MIPS_PC19_S2)[20:0]
R_MIPS_PC19_S2:
lwpc $6,foo
# Test R_MIPS_PC21_S2 relocation.
# rtdyld-check: decode_operand(R_MIPS_PC21_S2, 1)[22:0] = (foo - next_pc(R_MIPS_PC21_S2) + 0x04)[22:0]
R_MIPS_PC21_S2:
bnezc $5,foo
# Test R_MIPS_PC26_S2 relocation.
# rtdyld-check: decode_operand(R_MIPS_PC26_S2, 0)[27:0] = (foo - next_pc(R_MIPS_PC26_S2) + 0x04)[27:0]
R_MIPS_PC26_S2:
balc foo
# Test R_MIPS_PCHI16 relocation.
# rtdyld-check: decode_operand(R_MIPS_PCHI16, 1)[15:0] = (foo - R_MIPS_PCHI16 + 0x8000)[31:16]
R_MIPS_PCHI16:
aluipc $5, %pcrel_hi(foo)
# Test R_MIPS_PCLO16 relocation.
# rtdyld-check: decode_operand(R_MIPS_PCLO16, 2)[15:0] = (foo - R_MIPS_PCLO16)[15:0]
R_MIPS_PCLO16:
addiu $5, $5, %pcrel_lo(foo)
.size bar, .-bar

View File

@@ -1,50 +0,0 @@
# RUN: rm -rf %t && mkdir -p %t
# RUN: llvm-mc -triple=mipsel-unknown-linux -mcpu=mips32r6 -filetype=obj -o %t/test_ELF_O32R6.o %s
# RUN: llc -mtriple=mipsel-unknown-linux -mcpu=mips32r6 -filetype=obj -o %t/test_ELF_ExternalFunction_O32R6.o %S/Inputs/ExternalFunction.ll
# RUN: llvm-rtdyld -triple=mipsel-unknown-linux -mcpu=mips32r6 -verify -map-section test_ELF_O32R6.o,.text=0x1000 -map-section test_ELF_ExternalFunction_O32R6.o,.text=0x10000 -check=%s %t/test_ELF_O32R6.o %t/test_ELF_ExternalFunction_O32R6.o
# RUN: llvm-mc -triple=mips-unknown-linux -mcpu=mips32r6 -filetype=obj -o %t/test_ELF_O32R6.o %s
# RUN: llc -mtriple=mips-unknown-linux -mcpu=mips32r6 -filetype=obj -o %t/test_ELF_ExternalFunction_O32R6.o %S/Inputs/ExternalFunction.ll
# RUN: llvm-rtdyld -triple=mips-unknown-linux -mcpu=mips32r6 -verify -map-section test_ELF_O32R6.o,.text=0x1000 -map-section test_ELF_ExternalFunction_O32R6.o,.text=0x10000 -check=%s %t/test_ELF_O32R6.o %t/test_ELF_ExternalFunction_O32R6.o
.text
.abicalls
.nan 2008
.text
.set nomicromips
.set nomips16
.set noreorder
.set nomacro
.set noat
.align 3
.globl bar
.type bar,@function
bar:
# Test R_MIPS_PC19_S2 relocation.
# rtdyld-check: decode_operand(R_MIPS_PC19_S2, 1)[20:0] = (foo - R_MIPS_PC19_S2)[20:0]
R_MIPS_PC19_S2:
lwpc $6,foo
# Test R_MIPS_PC21_S2 relocation.
# rtdyld-check: decode_operand(R_MIPS_PC21_S2, 1)[22:0] = (foo - next_pc(R_MIPS_PC21_S2) + 0x04)[22:0]
R_MIPS_PC21_S2:
bnezc $5,foo
# Test R_MIPS_PC26_S2 relocation.
# rtdyld-check: decode_operand(R_MIPS_PC26_S2, 0)[27:0] = (foo - next_pc(R_MIPS_PC26_S2) + 0x04)[27:0]
R_MIPS_PC26_S2:
balc foo
# Test R_MIPS_PCHI16 relocation.
# rtdyld-check: decode_operand(R_MIPS_PCHI16, 1)[15:0] = (foo - R_MIPS_PCHI16 + 0x8000)[31:16]
R_MIPS_PCHI16:
aluipc $5, %pcrel_hi(foo)
# Test R_MIPS_PCLO16 relocation.
# rtdyld-check: decode_operand(R_MIPS_PCLO16, 2)[15:0] = (foo - R_MIPS_PCLO16)[15:0]
R_MIPS_PCLO16:
addiu $5, $5, %pcrel_lo(foo)
.size bar, .-bar

View File

@@ -1,65 +0,0 @@
# RUN: rm -rf %t && mkdir -p %t
# RUN: llvm-mc -triple=mipsel-unknown-linux -filetype=obj -o %t/test_ELF_O32.o %s
# RUN: llc -mtriple=mipsel-unknown-linux -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,"<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
# RUN: llvm-mc -triple=mips-unknown-linux -filetype=obj -o %t/test_ELF_O32.o %s
# RUN: llc -mtriple=mips-unknown-linux -filetype=obj -o %t/test_ELF_ExternalFunction_O32.o %S/Inputs/ExternalFunction.ll
# 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
.data
# rtdyld-check: *{4}R_MIPS_32 = foo[31:0]
R_MIPS_32:
.word foo
# rtdyld-check: *{4}(R_MIPS_32+4) = foo[31:0]
.4byte foo
# rtdyld-check: *{4}(R_MIPS_PC32) = (foo - R_MIPS_PC32)[31:0]
R_MIPS_PC32:
.word foo-.
# rtdyld-check: *{4}(R_MIPS_PC32 + 4) = (foo - tmp1)[31:0]
tmp1:
.4byte foo-tmp1
.text
.abicalls
.nan legacy
.text
.set nomicromips
.set nomips16
.set noreorder
.set nomacro
.set noat
.align 3
.globl bar
.type bar,@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_PC16, 1)[17:0] = (foo - R_MIPS_PC16)[17:0]
R_MIPS_PC16:
bal 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)
# rtdyld-check: decode_operand(R_MIPS_HI16_ADDEND, 1)[15:0] = (var+0x8008)[31:16]
R_MIPS_HI16_ADDEND:
lui $2, %hi(var+8)
# rtdyld-check: decode_operand(R_MIPS_LO16_ADDEND, 2)[15:0] = (var+0x8)[15:0]
R_MIPS_LO16_ADDEND:
lb $2, %lo(var+8)($2)
.size bar, .-bar
.comm var,9,1

View File

@@ -1,4 +0,0 @@
define void @foo() {
entry:
ret void
}

View File

@@ -1,3 +0,0 @@
if not 'Mips' in config.root.targets:
config.unsupported = True

View File

@@ -1,3 +0,0 @@
if not 'PowerPC' in config.root.targets:
config.unsupported = True

View File

@@ -1,47 +0,0 @@
# RUN: llvm-mc -triple=powerpc-unknown-linux-gnu -filetype=obj -o %t %s
# RUN: llvm-rtdyld -triple=powerpc-unknown-linux-gnu -verify -check=%s %t
.text
.file "ppc32_elf_rel_addr16.ll"
.globl lookup
.align 2
.type lookup,@function
lookup: # @lookup
.Lfunc_begin0:
# %bb.0:
stw 31, -4(1)
stwu 1, -16(1)
insn_hi:
# Check the higher 16-bits of the symbol's absolute address
# rtdyld-check: decode_operand(insn_hi, 1) = elements[31:16]
lis 4, elements@ha
slwi 3, 3, 2
mr 31, 1
insn_lo:
# Check the lower 16-bits of the symbol's absolute address
# rtdyld-check: decode_operand(insn_lo, 2) = elements[15:0]
la 4, elements@l(4)
lwzx 3, 4, 3
addi 1, 1, 16
lwz 31, -4(1)
blr
.Lfunc_end0:
.size lookup, .Lfunc_end0-.Lfunc_begin0
.type elements,@object # @elements
.data
.globl elements
.align 2
elements:
.long 14 # 0xe
.long 4 # 0x4
.long 1 # 0x1
.long 3 # 0x3
.long 13 # 0xd
.long 0 # 0x0
.long 32 # 0x20
.long 334 # 0x14e
.size elements, 32
.ident "clang version 3.7.0 "
.section ".note.GNU-stack","",@progbits

Some files were not shown because too many files have changed in this diff Show More