xref: /llvm-project/llvm/test/Transforms/CanonicalizeAliases/canonicalize.ll (revision 1f14056aefe878f3678aff5dd7778017bca836a1)
1cee313d2SEric Christopher; RUN: opt -S -passes=canonicalize-aliases < %s | FileCheck %s
272badbcdSArthur Eubanks; RUN: opt -passes='thinlto-pre-link<O0>,require<module-summary>' -o - < %s | llvm-dis -o - | FileCheck %s
3cee313d2SEric Christopher
4cee313d2SEric Christophertarget datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
5cee313d2SEric Christophertarget triple = "x86_64-unknown-linux-gnu"
6cee313d2SEric Christopher
7*1f14056aSNikita Popov; CHECK-DAG: @analias = alias void (), ptr @aliasee
8*1f14056aSNikita Popov; CHECK-DAG: @anotheralias = alias void (), ptr @aliasee
9cee313d2SEric Christopher; CHECK-DAG: define void @aliasee()
10cee313d2SEric Christopher
11*1f14056aSNikita Popov@analias = alias void (), ptr @anotheralias
12*1f14056aSNikita Popov@anotheralias = alias void (), ptr @aliasee
13cee313d2SEric Christopher
14cee313d2SEric Christopher; Function Attrs: nounwind uwtable
15cee313d2SEric Christopherdefine void @aliasee() #0 {
16cee313d2SEric Christopherentry:
17cee313d2SEric Christopher    ret void
18cee313d2SEric Christopher}
19cee313d2SEric Christopher
20cee313d2SEric Christopher%struct.S1 = type { i32, i32, i32 }
21cee313d2SEric Christopher
22cee313d2SEric Christopher; CHECK-DAG: @S = global %struct.S1 { i32 31, i32 32, i32 33 }
23*1f14056aSNikita Popov; CHECK-DAG: @Salias = alias i32, getelementptr inbounds (%struct.S1, ptr @S, i32 0, i32 1)
24*1f14056aSNikita Popov; CHECK-DAG: @Salias2 = alias i32, getelementptr inbounds (%struct.S1, ptr @S, i32 0, i32 1)
25*1f14056aSNikita Popov; CHECK-DAG: @Salias3 = alias i32, getelementptr inbounds (%struct.S1, ptr @S, i32 0, i32 1)
26cee313d2SEric Christopher
27cee313d2SEric Christopher@S = global %struct.S1 { i32 31, i32 32, i32 33 }, align 4
28*1f14056aSNikita Popov@Salias = alias i32, getelementptr inbounds (%struct.S1, ptr @S, i32 0, i32 1)
29*1f14056aSNikita Popov@Salias2 = alias i32, ptr @Salias
30*1f14056aSNikita Popov@Salias3 = alias i32, ptr @Salias2
31cee313d2SEric Christopher
32*1f14056aSNikita Popov; CHECK-DAG: @Salias4 = alias %struct.S1, ptr @S
33*1f14056aSNikita Popov; CHECK-DAG: @Salias5 = alias i32, getelementptr inbounds (%struct.S1, ptr @S, i32 0, i32 1)
34cee313d2SEric Christopher
35*1f14056aSNikita Popov@Salias4 = alias %struct.S1, ptr @S
36*1f14056aSNikita Popov@Salias5 = alias i32, getelementptr inbounds (%struct.S1, ptr @Salias4, i32 0, i32 1)
37