1 ; RUN: opt %loadPolly -polly-print-scops -disable-output < %s | FileCheck %s
3 ; Verify we do not generate an empty invalid context only because the wrap
4 ; in the second conditional will always happen if the block is executed.
6 ; CHECK: Invalid Context:
7 ; CHECK-NEXT: [N] -> { : N > 0 }
9 ; void f(char *A, char N) {
10 ; for (char i = 0; i < 10; i++) {
12 ; if (1 + 127 * N > 0)
18 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
20 define void @f(ptr %A, i8 signext %N) {
24 for.cond: ; preds = %for.inc, %entry
25 %indvars.iv = phi i8 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
26 %exitcond = icmp ne i8 %indvars.iv, 10
27 br i1 %exitcond, label %for.body, label %for.end
29 for.body: ; preds = %for.cond
30 %cmp3 = icmp sgt i8 %N, 0
31 br i1 %cmp3, label %if.then, label %if.end10
33 if.then: ; preds = %for.body
36 %cmp7 = icmp sgt i8 %add, 0
37 br i1 %cmp7, label %if.then9, label %if.end10
39 if.then9: ; preds = %if.end
40 %arrayidx = getelementptr inbounds i8, ptr %A, i8 %indvars.iv
41 store i8 1, ptr %arrayidx, align 1
44 if.end10: ; preds = %if.then9, %if.end
45 %arrayidx12 = getelementptr inbounds i8, ptr %A, i8 %indvars.iv
46 store i8 0, ptr %arrayidx12, align 1
49 for.inc: ; preds = %if.end10, %if.then
50 %indvars.iv.next = add nuw nsw i8 %indvars.iv, 1
53 for.end: ; preds = %for.cond