xref: /llvm-project/llvm/test/tools/gold/X86/weak.ll (revision 146f7fec952192d3118f84720d0998e1888fb793)
1; RUN: llvm-as %s -o %t.o
2; RUN: llvm-as %p/Inputs/weak.ll -o %t2.o
3
4; RUN: %gold -plugin %llvmshlibdir/LLVMgold%shlibext \
5; RUN:    --plugin-opt=emit-llvm \
6; RUN:    -shared %t.o %t2.o -o %t3.o
7; RUN: llvm-dis %t3.o -o - | FileCheck %s
8
9target triple = "x86_64-unknown-linux-gnu"
10target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
11
12@a = weak global i32 42
13@b = global ptr @a
14
15; Test that @b and @c end up pointing to the same variable.
16
17; CHECK: @b = global ptr @a{{$}}
18; CHECK: @a = weak global i32 42
19; CHECK: @c = global ptr @a{{$}}
20