27 lines · plain
1# RUN: rm -rf %t && mkdir -p %t2# RUN: llvm-mc -triple=x86_64-unknown-linux -x86-relax-relocations=false -position-independent -filetype=obj -o %t/elf_common.o %s3# RUN: llvm-jitlink -entry=load_common -noexec -check %s %t/elf_common.o4#5# Check that common variable GOT entry is synthesized correctly.6 7 .text8 .globl load_common9 .p2align 4, 0x9010 .type load_common,@function11 12load_common:13# In order to prevent the optimizer from relaxing the edge, we use a movl14# instruction.15# jitlink-check: decode_operand(load_common, 4) = \16# jitlink-check: got_addr(elf_common.o, common_data) - next_pc(load_common)17# jitlink-check: *{8}(got_addr(elf_common.o, common_data)) = common_data18 movl common_data@GOTPCREL(%rip), %eax19 ret20 21 .size load_common, .-load_common22 23# Check that common is zero-filled.24# jitlink-check: *{4}(common_data) = 025 .type common_data,@object26 .comm common_data,4,427