1 ; This test ensures that when linkonce_odr + unnamed_addr symbols promoted to
2 ; weak symbols, it preserves the auto hide property when possible.
4 ; RUN: opt -module-summary %s -o %t.o
5 ; RUN: opt -module-summary %p/Inputs/linkonce_odr_unnamed_addr.ll -o %t2.o
6 ; RUN: %gold -plugin %llvmshlibdir/LLVMgold%shlibext \
7 ; RUN: --plugin-opt=save-temps \
8 ; RUN: %t.o %t2.o -o %t3.o
9 ; RUN: llvm-dis %t.o.1.promote.bc -o - | FileCheck %s
11 ; Now test when one module is a native object. In that case we must be
12 ; conservative and not auto hide.
13 ; RUN: llc %p/Inputs/linkonce_odr_unnamed_addr.ll -o %t2native.o -filetype=obj
14 ; RUN: %gold -plugin %llvmshlibdir/LLVMgold%shlibext \
15 ; RUN: --plugin-opt=save-temps \
16 ; RUN: %t.o %t2native.o -o %t3.o
17 ; RUN: llvm-dis %t.o.1.promote.bc -o - | FileCheck %s --check-prefix=NOSUMMARY
19 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
20 target triple = "x86_64-grtev4-linux-gnu"
22 ; In this case all copies are linkonce_odr, so it may be hidden.
23 ; CHECK: @linkonceodrunnamed = weak_odr hidden unnamed_addr constant i32 0
24 ; NOSUMMARY: @linkonceodrunnamed = weak_odr dso_local unnamed_addr constant i32 0
25 @linkonceodrunnamed = linkonce_odr unnamed_addr constant i32 0
27 ; In this case, the other copy was weak_odr, so it may not be hidden.
28 ; CHECK: @odrunnamed = weak_odr dso_local unnamed_addr constant i32 0
29 ; NOSUMMARY: @odrunnamed = weak_odr dso_local unnamed_addr constant i32 0
30 @odrunnamed = linkonce_odr unnamed_addr constant i32 0