1# RUN: rm -rf %t && mkdir -p %t 2# RUN: llvm-mc -triple=x86_64-unknown-linux -position-independent -filetype=obj -o %t/elf_common.o %s 3# RUN: llvm-jitlink -entry=load_common -noexec -check %s %t/elf_common.o 4 5 .text 6 .file "elf_common.c" 7 .globl load_common 8 .p2align 4, 0x90 9 .type load_common,@function 10 11load_common: 12# Check that common variable GOT entry is synthesized correctly. In order to 13# prevent the optimizer from relaxing the edge, we use a movl instruction. 14# jitlink-check: decode_operand(load_common, 4) = \ 15# jitlink-check: got_addr(elf_common.o, common_data) - next_pc(load_common) 16# jitlink-check: *{8}(got_addr(elf_common.o, common_data)) = common_data 17 movl common_data@GOTPCREL(%rip), %eax 18 ret 19 20 .size load_common, .-load_common 21 22# Check that common is zero-filled. 23# jitlink-check: *{4}(common_data) = 0 24 .type common_data,@object 25 .comm common_data,4,4 26