xref: /aosp_15_r20/external/llvm/test/tools/gold/X86/weak.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llvm-as %s -o %t.o
2*9880d681SAndroid Build Coastguard Worker; RUN: llvm-as %p/Inputs/weak.ll -o %t2.o
3*9880d681SAndroid Build Coastguard Worker
4*9880d681SAndroid Build Coastguard Worker; RUN: %gold -plugin %llvmshlibdir/LLVMgold.so \
5*9880d681SAndroid Build Coastguard Worker; RUN:    --plugin-opt=emit-llvm \
6*9880d681SAndroid Build Coastguard Worker; RUN:    -shared %t.o %t2.o -o %t3.o
7*9880d681SAndroid Build Coastguard Worker; RUN: llvm-dis %t3.o -o - | FileCheck %s
8*9880d681SAndroid Build Coastguard Worker
9*9880d681SAndroid Build Coastguard Worker@a = weak global i32 42
10*9880d681SAndroid Build Coastguard Worker@b = global i32* @a
11*9880d681SAndroid Build Coastguard Worker
12*9880d681SAndroid Build Coastguard Worker; Test that @b and @c end up pointing to the same variable.
13*9880d681SAndroid Build Coastguard Worker
14*9880d681SAndroid Build Coastguard Worker; CHECK: @a = weak global i32 42
15*9880d681SAndroid Build Coastguard Worker; CHECK: @b = global i32* @a{{$}}
16*9880d681SAndroid Build Coastguard Worker; CHECK: @c = global i32* @a{{$}}
17