[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / polly / test / ScopInfo / BoundChecks / two-loops.ll
blob14e07f42a3aeb99eac0331dc4cecfc300016b958
1 ; RUN: opt %loadPolly -polly-print-scops -disable-output< %s | FileCheck %s
2 ; RUN: opt %loadPolly -polly-print-ast -disable-output < %s | FileCheck %s --check-prefix=AST
4 ; This only works after the post-dominator tree has fixed.
5 ; XFAIL: *
7 ;    void exception() __attribute__((noreturn));
9 ;    void foo(long n, float A[100]) {
10 ;      for (long j = 0; j < n; j++) {
11 ;        for (long i = j; i < n; i++) {
12 ;          if (i < 0)
13 ;            exception();
15 ;          if (i >= 100)
16 ;            exception();
18 ;          A[i] += i;
19 ;        }
20 ;      }
21 ;    }
23 ; CHECK: Assumed Context:
24 ; CHECK:  [n] -> {  : n >= 101 }
26 ; AST: if (1 && 0 == n >= 101)
27 ; AST:     for (int c0 = 0; c0 < n; c0 += 1)
28 ; AST:       for (int c1 = 0; c1 < n - c0; c1 += 1)
29 ; AST:         Stmt_if_end_7(c0, c1);
31 ; AST-NOT: for
32 ; AST-NOT: Stmt
34 ; AST: else
35 ; AST:     {  /* original code */ }
36 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
38 define void @foo(i64 %n, ptr %A) #0 {
39 entry:
40   br label %for.cond
42 for.cond:                                         ; preds = %for.inc.8, %entry
43   %j.0 = phi i64 [ 0, %entry ], [ %inc9, %for.inc.8 ]
44   %cmp = icmp slt i64 %j.0, %n
45   br i1 %cmp, label %for.body, label %for.end.10
47 for.body:                                         ; preds = %for.cond
48   br label %for.cond.1
50 for.cond.1:                                       ; preds = %for.inc, %for.body
51   %i.0 = phi i64 [ %j.0, %for.body ], [ %inc, %for.inc ]
52   %cmp2 = icmp slt i64 %i.0, %n
53   br i1 %cmp2, label %for.body.3, label %for.end
55 for.body.3:                                       ; preds = %for.cond.1
56   br i1 false, label %if.then, label %if.end
58 if.then:                                          ; preds = %for.body.3
59   call void (...) @exception() #2
60   unreachable
62 if.end:                                           ; preds = %for.body.3
63   %cmp5 = icmp sgt i64 %i.0, 99
64   br i1 %cmp5, label %if.then.6, label %if.end.7
66 if.then.6:                                        ; preds = %if.end
67   call void (...) @exception() #2
68   unreachable
70 if.end.7:                                         ; preds = %if.end
71   %conv = sitofp i64 %i.0 to float
72   %arrayidx = getelementptr inbounds float, ptr %A, i64 %i.0
73   %tmp = load float, ptr %arrayidx, align 4
74   %add = fadd float %tmp, %conv
75   store float %add, ptr %arrayidx, align 4
76   br label %for.inc
78 for.inc:                                          ; preds = %if.end.7
79   %inc = add nuw nsw i64 %i.0, 1
80   br label %for.cond.1
82 for.end:                                          ; preds = %for.cond.1
83   br label %for.inc.8
85 for.inc.8:                                        ; preds = %for.end
86   %inc9 = add nuw nsw i64 %j.0, 1
87   br label %for.cond
89 for.end.10:                                       ; preds = %for.cond
90   ret void
93 declare void @exception(...) #1
95 attributes #0 = { nounwind uwtable "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" }
96 attributes #1 = { noreturn "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" }
97 attributes #2 = { noreturn nounwind }
99 !llvm.ident = !{!0}
101 !0 = !{!"clang version 3.8.0 (trunk 246853)"}