1 ; RUN: llvm-link -S -o - %s %p/Inputs/comdat16.ll | FileCheck %s
5 @v1 = weak_odr global i32 42, comdat($c1)
6 define weak_odr i32 @f1(i8*) comdat($c1) {
13 @r11 = global i32* @v1
14 @r12 = global i32 (i8*)* @f1
16 @a11 = alias i32, i32* @v1
17 @a12 = alias i16, bitcast (i32* @v1 to i16*)
19 @a13 = alias i32 (i8*), i32 (i8*)* @f1
20 @a14 = alias i16, bitcast (i32 (i8*)* @f1 to i16*)
21 @a15 = alias i16, i16* @a14
23 ; CHECK: $c1 = comdat any
24 ; CHECK: $c2 = comdat any
26 ; CHECK-DAG: @will_be_undefined = external global i32
28 ; CHECK-DAG: @v1 = weak_odr global i32 42, comdat($c1)
30 ; CHECK-DAG: @r11 = global i32* @v1{{$}}
31 ; CHECK-DAG: @r12 = global i32 (i8*)* @f1{{$}}
33 ; CHECK-DAG: @r21 = global i32* @v1{{$}}
34 ; CHECK-DAG: @r22 = global i32 (i8*)* @f1{{$}}
36 ; CHECK-DAG: @v1.1 = internal global i32 41, comdat($c2)
38 ; CHECK-DAG: @a11 = alias i32, i32* @v1{{$}}
39 ; CHECK-DAG: @a12 = alias i16, bitcast (i32* @v1 to i16*)
41 ; CHECK-DAG: @a13 = alias i32 (i8*), i32 (i8*)* @f1{{$}}
42 ; CHECK-DAG: @a14 = alias i16, bitcast (i32 (i8*)* @f1 to i16*)
44 ; CHECK-DAG: @a21 = alias i32, i32* @v1.1{{$}}
45 ; CHECK-DAG: @a22 = alias i16, bitcast (i32* @v1.1 to i16*)
47 ; CHECK-DAG: @a23 = alias i32 (i8*), i32 (i8*)* @f1.2{{$}}
48 ; CHECK-DAG: @a24 = alias i16, bitcast (i32 (i8*)* @f1.2 to i16*)
50 ; CHECK: define weak_odr protected i32 @f1(i8*) comdat($c1) {
52 ; CHECK-NEXT: br label %bb11{{$}}
54 ; CHECK-NEXT: ret i32 42
57 ; CHECK: define internal i32 @f1.2(i8* %this) comdat($c2) {
59 ; CHECK-NEXT: store i8* %this, i8** null
60 ; CHECK-NEXT: br label %bb21
62 ; CHECK-NEXT: ret i32 41