1 ; RUN: llvm-as %s -o %t1.o
2 ; RUN: llvm-as %p/Inputs/comdat.ll -o %t2.o
3 ; RUN: %gold -shared -o %t3.o -plugin %llvmshlibdir/LLVMgold%shlibext %t1.o %t2.o \
5 ; RUN: -plugin-opt=save-temps
6 ; RUN: FileCheck --check-prefix=RES %s < %t3.o.resolution.txt
7 ; RUN: llvm-readobj --symbols %t3.o | FileCheck --check-prefix=OBJ %s
9 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
10 target triple = "x86_64-unknown-linux-gnu"
14 @v1 = weak_odr global i32 42, comdat($c1)
15 define weak_odr i32 @f1(i8*) comdat($c1) {
22 @r11 = global i32* @v1
23 @r12 = global i32 (i8*)* @f1
25 @a11 = alias i32, i32* @v1
26 @a12 = alias i16, bitcast (i32* @v1 to i16*)
28 @a13 = alias i32 (i8*), i32 (i8*)* @f1
29 @a14 = alias i16, bitcast (i32 (i8*)* @f1 to i16*)
30 @a15 = alias i16, i16* @a14
32 ; gold's resolutions should tell us that our $c1 wins, and the other input's $c2
33 ; wins. f1 is also local due to having protected visibility in the other object.
35 ; RES: 1.o,f1,plx{{$}}
37 ; RES: 1.o,r11,px{{$}}
38 ; RES: 1.o,r12,px{{$}}
39 ; RES: 1.o,a11,px{{$}}
40 ; RES: 1.o,a12,px{{$}}
41 ; RES: 1.o,a13,px{{$}}
42 ; RES: 1.o,a14,px{{$}}
43 ; RES: 1.o,a15,px{{$}}
46 ; RES: 2.o,will_be_undefined,{{$}}
48 ; RES: 2.o,r21,px{{$}}
49 ; RES: 2.o,r22,px{{$}}
50 ; RES: 2.o,a21,px{{$}}
51 ; RES: 2.o,a22,px{{$}}
52 ; RES: 2.o,a23,px{{$}}
53 ; RES: 2.o,a24,px{{$}}
54 ; RES: 2.o,a25,px{{$}}
56 ; f1's protected visibility should be reflected in the DSO.
64 ; OBJ-NEXT: STV_PROTECTED