1 ; RUN: llvm-as %s -o %t1.o 2 ; RUN: llvm-as %p/Inputs/common.ll -o %t2.o 3 ; RUN: llvm-as %p/Inputs/common2.ll -o %t2b.o 4 ; RUN: llvm-as %p/Inputs/common3.ll -o %t2c.o 5 6 @a = common global i16 0, align 8 7 8 ; RUN: %gold -plugin %llvmshlibdir/LLVMgold.so \ 9 ; RUN: --plugin-opt=emit-llvm \ 10 ; RUN: -shared %t1.o %t2.o -o %t3.o 11 ; RUN: llvm-dis %t3.o -o - | FileCheck %s --check-prefix=A 12 13 ; Shared library case, we merge @a as common and keep it for the symbol table. 14 ; A: @a = common global i32 0, align 8 15 16 ; RUN: %gold -plugin %llvmshlibdir/LLVMgold.so \ 17 ; RUN: --plugin-opt=emit-llvm \ 18 ; RUN: -shared %t1.o %t2b.o -o %t3.o 19 ; RUN: llvm-dis %t3.o -o - | FileCheck %s --check-prefix=B 20 21 ; (i16 align 8) + (i8 align 16) = i16 align 16 22 ; B: @a = common global i16 0, align 16 23 24 ; RUN: %gold -plugin %llvmshlibdir/LLVMgold.so \ 25 ; RUN: --plugin-opt=emit-llvm \ 26 ; RUN: -shared %t1.o %t2c.o -o %t3.o 27 ; RUN: llvm-dis %t3.o -o - | FileCheck %s --check-prefix=C 28 29 ; (i16 align 8) + (i8 align 1) = i16 align 8. 30 ; C: @a = common global i16 0, align 8 31 32 ; RUN: %gold -plugin %llvmshlibdir/LLVMgold.so \ 33 ; RUN: --plugin-opt=emit-llvm \ 34 ; RUN: %t1.o %t2.o -o %t3.o 35 ; RUN: llvm-dis %t3.o -o - | FileCheck --check-prefix=EXEC %s 36 37 ; All IR case, we internalize a after merging. 38 ; EXEC: @a = internal global i32 0, align 8 39 40 ; RUN: llc %p/Inputs/common.ll -o %t2native.o -filetype=obj 41 ; RUN: %gold -plugin %llvmshlibdir/LLVMgold.so \ 42 ; RUN: --plugin-opt=emit-llvm \ 43 ; RUN: %t1.o %t2native.o -o %t3.o 44 ; RUN: llvm-dis %t3.o -o - | FileCheck --check-prefix=MIXED %s 45 46 ; Mixed ELF and IR. We keep ours as common so the linker will finish the merge. 47 ; MIXED: @a = common global i16 0, align 8 48