1 ; RUN: opt -aa-pipeline=basic-aa,globals-aa -passes='require<globals-aa>,gvn' < %s -S | FileCheck %s
3 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
4 target triple = "x86_64-unknown-linux-gnu"
6 ; @o and @m are initialized to @i, so they should not be classed as
7 ; indirect globals referring only to allocation functions.
8 @o = internal global ptr @i, align 8
9 @m = internal global ptr @i, align 8
10 @i = internal global i32 0, align 4
15 %0 = load ptr, ptr @o, align 8
16 store i32 0, ptr %0, align 4
17 %1 = load volatile ptr, ptr @m, align 8
18 store i32 1, ptr %1, align 4
19 ; CHECK: %[[a:.*]] = load ptr
20 %2 = load ptr, ptr @o, align 8
21 ; CHECK: %[[b:.*]] = load i32, ptr %[[a]]
22 %3 = load i32, ptr %2, align 4
23 ; CHECK: %[[c:.*]] = icmp ne i32 %[[b]], 0
24 %tobool.i = icmp ne i32 %3, 0
25 ; CHECK: ret i1 %[[c]]