1; RUN: opt -analyze -scalar-evolution -scalar-evolution < %s | FileCheck %s
2
3define void @bad.nsw() {
4; CHECK-LABEL: Classifying expressions for: @bad.nsw
5; CHECK-LABEL: Classifying expressions for: @bad.nsw
6 entry:
7  br label %loop
8
9 loop:
10  %i = phi i8 [ -1, %entry ], [ %i.inc, %loop ]
11; CHECK:  %i = phi i8 [ -1, %entry ], [ %i.inc, %loop ]
12; CHECK-NEXT: -->  {-1,+,-128}<nw><%loop>
13; CHECK-NOT: -->  {-1,+,-128}<nsw><%loop>
14
15  %counter = phi i8 [ 0, %entry ], [ %counter.inc, %loop ]
16
17  %i.inc = add i8 %i, -128
18  %i.sext = sext i8 %i to i16
19
20  %counter.inc = add i8 %counter, 1
21  %continue = icmp eq i8 %counter, 1
22  br i1 %continue, label %exit, label %loop
23
24 exit:
25  ret void
26}
27