[Alignment][NFC] Instructions::getLoadStoreAlignment
[llvm-complete.git] / test / ExecutionEngine / RuntimeDyld / Mips / ELF_O32_PIC_relocations.s
blob40002d44a10d65024a67045b688d2e73728af69e
1 # RUN: rm -rf %t && mkdir -p %t
2 # RUN: llvm-mc -triple=mipsel-unknown-linux -filetype=obj -o %t/test_ELF_O32.o %s
3 # RUN: llc -mtriple=mipsel-unknown-linux -filetype=obj -o %t/test_ELF_ExternalFunction_O32.o %S/Inputs/ExternalFunction.ll
4 # 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
6 # RUN: llvm-mc -triple=mips-unknown-linux -filetype=obj -o %t/test_ELF_O32.o %s
7 # RUN: llc -mtriple=mips-unknown-linux -filetype=obj -o %t/test_ELF_ExternalFunction_O32.o %S/Inputs/ExternalFunction.ll
8 # 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
10 .data
11 # rtdyld-check: *{4}R_MIPS_32 = foo[31:0]
12 R_MIPS_32:
13 .word foo
14 # rtdyld-check: *{4}(R_MIPS_32+4) = foo[31:0]
15 .4byte foo
16 # rtdyld-check: *{4}(R_MIPS_PC32) = (foo - R_MIPS_PC32)[31:0]
17 R_MIPS_PC32:
18 .word foo-.
19 # rtdyld-check: *{4}(R_MIPS_PC32 + 4) = (foo - tmp1)[31:0]
20 tmp1:
21 .4byte foo-tmp1
23 .text
24 .abicalls
25 .nan legacy
26 .text
27 .set nomicromips
28 .set nomips16
29 .set noreorder
30 .set nomacro
31 .set noat
33 .align 3
34 .globl bar
35 .type bar,@function
36 bar:
37 # rtdyld-check: decode_operand(R_MIPS_26, 0)[27:0] = stub_addr(test_ELF_O32.o/.text, foo)[27:0]
38 # rtdyld-check: decode_operand(R_MIPS_26, 0)[1:0] = 0
39 R_MIPS_26:
40 j foo
41 nop
43 # rtdyld-check: decode_operand(R_MIPS_PC16, 1)[17:0] = (foo - R_MIPS_PC16)[17:0]
44 R_MIPS_PC16:
45 bal foo
46 nop
48 # rtdyld-check: decode_operand(R_MIPS_HI16, 1)[15:0] = foo[31:16]
49 R_MIPS_HI16:
50 lui $1, %hi(foo)
52 # rtdyld-check: decode_operand(R_MIPS_LO16, 1)[15:0] = foo[15:0]
53 R_MIPS_LO16:
54 lui $1, %lo(foo)
56 # rtdyld-check: decode_operand(R_MIPS_HI16_ADDEND, 1)[15:0] = (var+0x8008)[31:16]
57 R_MIPS_HI16_ADDEND:
58 lui $2, %hi(var+8)
60 # rtdyld-check: decode_operand(R_MIPS_LO16_ADDEND, 2)[15:0] = (var+0x8)[15:0]
61 R_MIPS_LO16_ADDEND:
62 lb $2, %lo(var+8)($2)
64 .size bar, .-bar
65 .comm var,9,1