1 ; RUN: llvm-as %s -o %t.o 2 ; RUN: llvm-as %p/Inputs/comdat.ll -o %t2.o 3 ; RUN: %gold -shared -o %t3.o -plugin %llvmshlibdir/LLVMgold.so %t.o %t2.o \ 4 ; RUN: -plugin-opt=emit-llvm 5 ; RUN: llvm-dis %t3.o -o - | FileCheck %s 6 7 $c1 = comdat any 8 9 @v1 = weak_odr global i32 42, comdat($c1) 10 define weak_odr i32 @f1(i8*) comdat($c1) { 11 bb10: 12 br label %bb11 13 bb11: 14 ret i32 42 15 } 16 17 @r11 = global i32* @v1 18 @r12 = global i32 (i8*)* @f1 19 20 @a11 = alias i32* @v1 21 @a12 = alias bitcast (i32* @v1 to i16*) 22 23 @a13 = alias i32 (i8*)* @f1 24 @a14 = alias bitcast (i32 (i8*)* @f1 to i16*) 25 @a15 = alias i16* @a14 26 27 ; CHECK: $c1 = comdat any 28 ; CHECK: $c2 = comdat any 29 30 ; CHECK: @v1 = weak_odr global i32 42, comdat($c1) 31 32 ; CHECK: @r11 = global i32* @v1{{$}} 33 ; CHECK: @r12 = global i32 (i8*)* @f1{{$}} 34 35 ; CHECK: @r21 = global i32* @v1{{$}} 36 ; CHECK: @r22 = global i32 (i8*)* @f1{{$}} 37 38 ; CHECK: @v11 = internal global i32 41, comdat($c2) 39 40 ; CHECK: @a11 = alias i32* @v1{{$}} 41 ; CHECK: @a12 = alias bitcast (i32* @v1 to i16*) 42 43 ; CHECK: @a13 = alias i32 (i8*)* @f1{{$}} 44 ; CHECK: @a14 = alias bitcast (i32 (i8*)* @f1 to i16*) 45 46 ; CHECK: @a21 = alias i32* @v11{{$}} 47 ; CHECK: @a22 = alias bitcast (i32* @v11 to i16*) 48 49 ; CHECK: @a23 = alias i32 (i8*)* @f12{{$}} 50 ; CHECK: @a24 = alias bitcast (i32 (i8*)* @f12 to i16*) 51 52 ; CHECK: define weak_odr protected i32 @f1(i8*) comdat($c1) { 53 ; CHECK-NEXT: bb10: 54 ; CHECK-NEXT: br label %bb11{{$}} 55 ; CHECK: bb11: 56 ; CHECK-NEXT: ret i32 42 57 ; CHECK-NEXT: } 58 59 ; CHECK: define internal i32 @f12(i8* %this) comdat($c2) { 60 ; CHECK-NEXT: bb20: 61 ; CHECK-NEXT: store i8* %this, i8** null 62 ; CHECK-NEXT: br label %bb21 63 ; CHECK: bb21: 64 ; CHECK-NEXT: ret i32 41 65 ; CHECK-NEXT: } 66