1 ; RUN: opt -passes='lto<O3>' -S %s | FileCheck %s
3 target triple = "arm64e-apple-darwin"
5 @A = external unnamed_addr global ptr, align 8
6 @B = external unnamed_addr global ptr, align 8
7 @C = internal unnamed_addr global i32 0, align 4
8 @D = external unnamed_addr global i32, align 4
15 %v.D = load i32, ptr @D, align 4
16 store i32 %v.D, ptr @C, align 4
19 %v.B = load ptr, ptr @B, align 8
20 %v.A = load ptr, ptr @A, align 8
21 %v.gep.1 = load ptr, ptr %v.A, align 8
22 %v.gep.2 = load ptr, ptr %v.B, align 8
23 %cmp = icmp eq ptr %v.gep.2, null
24 br i1 %cmp, label %exit, label %loop
27 %iv = phi i32 [ 0, %entry ], [ %iv.next, %loop ]
28 %gep.3 = getelementptr inbounds i8, ptr %v.gep.2, i32 %iv
29 %v.gep.3 = load i8, ptr %gep.3, align 1
30 %gep.4 = getelementptr inbounds i8, ptr %v.gep.1, i32 %iv
31 store i8 %v.gep.3, ptr %gep.4, align 1
32 %iv.next = add nuw nsw i32 %iv, 1
33 %v.C = load i32, ptr @C, align 4
34 %exit.cond = icmp sgt i32 %iv, %v.C
35 br i1 %exit.cond, label %exit, label %loop
41 declare void @clobber()