1 ; RUN: llvm-as %s -o %t.o
2 ; RUN: llvm-as %p/Inputs/comdat.ll -o %t2.o
3 ; RUN: llvm-lto2 run -save-temps -o %t3.o %t.o %t2.o \
4 ; RUN: -r=%t.o,f1,plx \
6 ; RUN: -r=%t.o,r11,px \
7 ; RUN: -r=%t.o,r12,px \
8 ; RUN: -r=%t.o,a11,px \
9 ; RUN: -r=%t.o,a12,px \
10 ; RUN: -r=%t.o,a13,px \
11 ; RUN: -r=%t.o,a14,px \
12 ; RUN: -r=%t.o,a15,px \
13 ; RUN: -r=%t2.o,f1,l \
14 ; RUN: -r=%t2.o,will_be_undefined, \
16 ; RUN: -r=%t2.o,r21,px \
17 ; RUN: -r=%t2.o,r22,px \
18 ; RUN: -r=%t2.o,a21,px \
19 ; RUN: -r=%t2.o,a22,px \
20 ; RUN: -r=%t2.o,a23,px \
21 ; RUN: -r=%t2.o,a24,px \
22 ; RUN: -r=%t2.o,a25,px
23 ; RUN: llvm-dis %t3.o.0.2.internalize.bc -o - | FileCheck %s
25 target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
26 target triple = "x86_64-unknown-linux-gnu"
30 @v1 = weak_odr global i32 42, comdat($c1)
31 define weak_odr i32 @f1(i8*) comdat($c1) {
38 @r11 = global i32* @v1
39 @r12 = global i32 (i8*)* @f1
41 @a11 = alias i32, i32* @v1
42 @a12 = alias i16, bitcast (i32* @v1 to i16*)
44 @a13 = alias i32 (i8*), i32 (i8*)* @f1
45 @a14 = alias i16, bitcast (i32 (i8*)* @f1 to i16*)
46 @a15 = alias i16, i16* @a14
48 ; CHECK: $c1 = comdat any
49 ; CHECK: $c2 = comdat any
51 ; CHECK-DAG: @v1 = weak_odr global i32 42, comdat($c1)
53 ; CHECK-DAG: @r11 = global i32* @v1{{$}}
54 ; CHECK-DAG: @r12 = global i32 (i8*)* @f1{{$}}
56 ; CHECK-DAG: @r21 = global i32* @v1{{$}}
57 ; CHECK-DAG: @r22 = global i32 (i8*)* @f1{{$}}
59 ; CHECK-DAG: @v1.1 = internal global i32 41, comdat($c2)
61 ; CHECK-DAG: @a11 = alias i32, i32* @v1{{$}}
62 ; CHECK-DAG: @a12 = alias i16, bitcast (i32* @v1 to i16*)
64 ; CHECK-DAG: @a13 = alias i32 (i8*), i32 (i8*)* @f1{{$}}
65 ; CHECK-DAG: @a14 = alias i16, bitcast (i32 (i8*)* @f1 to i16*)
67 ; CHECK-DAG: @a21 = alias i32, i32* @v1.1{{$}}
68 ; CHECK-DAG: @a22 = alias i16, bitcast (i32* @v1.1 to i16*)
70 ; CHECK-DAG: @a23 = alias i32 (i8*), i32 (i8*)* @f1.2{{$}}
71 ; CHECK-DAG: @a24 = alias i16, bitcast (i32 (i8*)* @f1.2 to i16*)
73 ; CHECK: define weak_odr dso_local i32 @f1(i8* %0) comdat($c1) {
75 ; CHECK-NEXT: br label %bb11{{$}}
77 ; CHECK-NEXT: ret i32 42
80 ; CHECK: define internal i32 @f1.2(i8* %this) comdat($c2) {
82 ; CHECK-NEXT: store i8* %this, i8** null
83 ; CHECK-NEXT: br label %bb21
85 ; CHECK-NEXT: ret i32 41