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