Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / llvm / test / ExecutionEngine / JITLink / i386 / ELF_i386_small_pic_relocations_got.s
blob91049a8a87a551845e02a4dc6051cc11df77d2b7
1 # RUN: rm -rf %t && mkdir -p %t
2 # RUN: llvm-mc -triple=i386-unknown-linux-gnu -position-independent \
3 # RUN: -filetype=obj -o %t/elf_sm_pic_reloc_got.o %s
4 # RUN: llvm-jitlink -noexec \
5 # RUN: -slab-allocate 100Kb -slab-address 0xfff00000 -slab-page-size 4096 \
6 # RUN: -check %s %t/elf_sm_pic_reloc_got.o
8 # Test ELF small/PIC GOT relocations.
10 .text
11 .globl main
12 .p2align 4, 0x90
13 .type main,@function
14 main:
15 ret
16 .size main, .-main
19 # Test GOT32 handling.
21 # We want to check both the offset to the GOT entry and its contents.
22 # jitlink-check: decode_operand(test_got, 4) = got_addr(elf_sm_pic_reloc_got.o, named_data1) - _GLOBAL_OFFSET_TABLE_
23 # jitlink-check: *{4}(got_addr(elf_sm_pic_reloc_got.o, named_data1)) = named_data1
25 # jitlink-check: decode_operand(test_got+6, 4) = got_addr(elf_sm_pic_reloc_got.o, named_data2) - _GLOBAL_OFFSET_TABLE_
26 # jitlink-check: *{4}(got_addr(elf_sm_pic_reloc_got.o, named_data2)) = named_data2
28 .globl test_got
29 .p2align 4, 0x90
30 .type test_got,@function
31 test_got:
32 leal named_data1@GOT, %eax
33 leal named_data2@GOT, %eax
34 .size test_got, .-test_got
38 # Test GOTOFF64 handling.
39 # jitlink-check: decode_operand(test_gotoff, 1) = named_func - _GLOBAL_OFFSET_TABLE_
40 .globl test_gotoff
41 .p2align 4, 0x90
42 .type test_gotoff,@function
43 test_gotoff:
44 mov $named_func@GOTOFF, %eax
45 .size test_gotoff, .-test_gotoff
48 .globl named_func
49 .p2align 4, 0x90
50 .type named_func,@function
51 named_func:
52 xor %eax, %eax
53 .size named_func, .-named_func
56 .data
58 .type named_data1,@object
59 .p2align 3
60 named_data1:
61 .quad 42
62 .size named_data1, 8
64 .type named_data2,@object
65 .p2align 3
66 named_data2:
67 .quad 42
68 .size named_data2, 8