1 ; RUN: opt -S -canonicalize-aliases < %s | FileCheck %s
2 ; RUN: opt -prepare-for-thinlto -O0 -module-summary -o - < %s | llvm-dis -o - | FileCheck %s
3 ; RUN: opt -S -passes=canonicalize-aliases < %s | FileCheck %s
5 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
6 target triple = "x86_64-unknown-linux-gnu"
8 ; CHECK-DAG: @analias = alias void (), void ()* @aliasee
9 ; CHECK-DAG: @anotheralias = alias void (), void ()* @aliasee
10 ; CHECK-DAG: define void @aliasee()
12 @analias = alias void (), void ()* @anotheralias
13 @anotheralias = alias void (), bitcast (void ()* @aliasee to void ()*)
15 ; Function Attrs: nounwind uwtable
16 define void @aliasee() #0 {
21 %struct.S1 = type { i32, i32, i32 }
23 ; CHECK-DAG: @S = global %struct.S1 { i32 31, i32 32, i32 33 }
24 ; CHECK-DAG: @Salias = alias i32, getelementptr inbounds (%struct.S1, %struct.S1* @S, i32 0, i32 1)
25 ; CHECK-DAG: @Salias2 = alias i32, getelementptr inbounds (%struct.S1, %struct.S1* @S, i32 0, i32 1)
26 ; CHECK-DAG: @Salias3 = alias i32, getelementptr inbounds (%struct.S1, %struct.S1* @S, i32 0, i32 1)
28 @S = global %struct.S1 { i32 31, i32 32, i32 33 }, align 4
29 @Salias = alias i32, getelementptr inbounds (%struct.S1, %struct.S1* @S, i32 0, i32 1)
30 @Salias2 = alias i32, i32* @Salias
31 @Salias3 = alias i32, i32* @Salias2
33 ; CHECK-DAG: @Salias4 = alias %struct.S1, %struct.S1* @S
34 ; CHECK-DAG: @Salias5 = alias i32, getelementptr inbounds (%struct.S1, %struct.S1* @S, i32 0, i32 1)
36 @Salias4 = alias %struct.S1, %struct.S1* @S
37 @Salias5 = alias i32, getelementptr inbounds (%struct.S1, %struct.S1* @Salias4, i32 0, i32 1)