1 ; RUN: opt %loadPolly -polly-detect < %s
3 ; This test case helps to determine wether SCEVRemoveMax::remove produces
4 ; an infinite loop and a segmentation fault, if it processes, for example,
5 ; '((-1 + (-1 * %b1)) umax {(-1 + (-1 * %yStart)),+,-1}<%.preheader>)'.
7 ; In this case, the SCoP is invalid. However, SCoP detection failed when
10 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
11 target triple = "x86_64-unknown-linux-gnu"
13 @vertPlane = external global i8*, align 8
15 define fastcc void @Maze2Mech(i64 %i, i64 %b1, i64 %yStart) {
17 br i1 undef, label %DrawSegment.exit, label %DrawSegment.exit34
19 DrawSegment.exit34: ; preds = %.split
20 %tmp = icmp ugt i64 %yStart, %b1
21 %tmp1 = select i1 %tmp, i64 %b1, i64 %yStart
22 %tmp2 = load i8*, i8** @vertPlane, align 8
23 %y.04.i21 = add i64 %tmp1, 1
26 .lr.ph.i24: ; preds = %.lr.ph.i24, %DrawSegment.exit34
27 %y.05.i22 = phi i64 [ %y.0.i23, %.lr.ph.i24 ], [ %y.04.i21, %DrawSegment.exit34 ]
28 %tmp3 = mul i64 %y.05.i22, undef
29 %tmp4 = add i64 %tmp3, %i
30 %tmp5 = getelementptr inbounds i8, i8* %tmp2, i64 %tmp4
31 %tmp6 = load i8, i8* %tmp5, align 1
32 %y.0.i23 = add nuw i64 %y.05.i22, 1
33 br i1 false, label %bb, label %.lr.ph.i24
35 bb: ; preds = %.lr.ph.i24
38 DrawSegment.exit: ; preds = %.split