1; REQUIRES: x86
2; RUN: llvm-as %s -o %t.o
3; RUN: llvm-mc %p/Inputs/unnamed-addr-lib.s -o %t2.o -filetype=obj -triple=x86_64-pc-linux
4; RUN: ld.lld %t2.o -shared -o %t2.so
5; RUN: ld.lld %t.o %t2.so -o %t.so -save-temps -shared
6; RUN: llvm-dis %t.so.0.2.internalize.bc -o - | FileCheck %s
7
8; This documents a small limitation of lld's internalization logic. We decide
9; that bar should be in the symbol table because if it is it will preempt the
10; one in the shared library.
11; We could add one extra bit for ODR so that we know that preemption is not
12; necessary, but that is probably not worth it.
13
14; CHECK: @foo = internal unnamed_addr constant i8 42
15; CHECK: @bar = weak_odr unnamed_addr constant i8 42
16
17target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
18target triple = "x86_64-unknown-linux-gnu"
19
20@foo = linkonce_odr unnamed_addr constant i8 42
21@bar = linkonce_odr unnamed_addr constant i8 42
22