1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -passes=indvars -S < %s | FileCheck %s
4 ; Check the case where one exit has a pointer EC, and the other doesn't.
5 ; Note that this test case is really really fragile. Removing any
6 ; instruction in the below causes the result to differ. Note that the lack
7 ; of a data layout (with pointer size info) is critical to getting a pointer
10 @global = external global [0 x i8], align 1
15 ; CHECK-NEXT: br label [[BB3:%.*]]
17 ; CHECK-NEXT: [[TMP6:%.*]] = load i8, ptr getelementptr inbounds ([0 x i8], ptr @global, i64 0, i64 1), align 1
18 ; CHECK-NEXT: br i1 false, label [[BB7:%.*]], label [[BB11:%.*]]
20 ; CHECK-NEXT: [[TMP8:%.*]] = zext i8 [[TMP6]] to i64
21 ; CHECK-NEXT: br i1 true, label [[BB11]], label [[BB3]]
23 ; CHECK-NEXT: ret void
28 bb3: ; preds = %bb7, %bb2
29 %tmp = phi ptr [ %tmp4, %bb7 ], [ getelementptr inbounds ([0 x i8], ptr @global, i64 0, i64 2), %bb ]
30 %tmp4 = getelementptr inbounds i8, ptr %tmp, i64 -1
31 %tmp6 = load i8, ptr %tmp4, align 1
32 %tmp5 = icmp ugt ptr %tmp4, getelementptr inbounds ([0 x i8], ptr @global, i64 0, i64 500)
33 br i1 %tmp5, label %bb7, label %bb11
36 %tmp8 = zext i8 %tmp6 to i64
37 %tmp10 = icmp eq i16 0, 0
38 br i1 %tmp10, label %bb11, label %bb3
40 bb11: ; preds = %bb7, %bb3