Update Polly tests to handle explicitly typed gep changes in LLVM
[polly-mirror.git] / test / Isl / single_loop_uint_max_iterations.ll
blobe481f526fe23647259507320fb54ac6f7545711f
1 ; RUN: opt %loadPolly -polly-detect-unprofitable -polly-no-early-exit -polly-ast -S -analyze  < %s | FileCheck %s
2 ; XFAIL: *
4 ;#include "limits.h"
5 ;#define N 20
7 ;int main () {
8 ;  unsigned int i;
9 ;  unsigned int A[N];
11 ;  A[0] = 0;
13 ;  __sync_synchronize();
15 ;  for (i = 0; i < UINT_MAX; i++)
16 ;    A[0] = i;
18 ;  __sync_synchronize();
20 ;  if (A[0] == UINT_MAX - 1)
21 ;    return 0;
22 ;  else
23 ;    return 1;
26 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
27 target triple = "x86_64-unknown-linux-gnu"
29 define i32 @main() nounwind {
30 entry:
31   %A = alloca [20 x i32], align 4                 ; <[20 x i32]*> [#uses=3]
32   %arraydecay = getelementptr inbounds [20 x i32], [20 x i32]* %A, i32 0, i32 0 ; <i32*> [#uses=1]
33   %arrayidx = getelementptr inbounds i32, i32* %arraydecay, i64 0 ; <i32*> [#uses=1]
34   store i32 0, i32* %arrayidx
35   fence seq_cst
36   br label %for.cond
38 for.cond:                                         ; preds = %for.inc, %entry
39   %0 = phi i32 [ 0, %entry ], [ %inc, %for.inc ]  ; <i32> [#uses=3]
40   %exitcond = icmp ne i32 %0, -1                  ; <i1> [#uses=1]
41   br i1 %exitcond, label %for.body, label %for.end
43 for.body:                                         ; preds = %for.cond
44   %arraydecay2 = getelementptr inbounds [20 x i32], [20 x i32]* %A, i32 0, i32 0 ; <i32*> [#uses=1]
45   %arrayidx3 = getelementptr inbounds i32, i32* %arraydecay2, i64 0 ; <i32*> [#uses=1]
46   store i32 %0, i32* %arrayidx3
47   br label %for.inc
49 for.inc:                                          ; preds = %for.body
50   %inc = add i32 %0, 1                            ; <i32> [#uses=1]
51   br label %for.cond
53 for.end:                                          ; preds = %for.cond
54   fence seq_cst
55   %arraydecay5 = getelementptr inbounds [20 x i32], [20 x i32]* %A, i32 0, i32 0 ; <i32*> [#uses=1]
56   %arrayidx6 = getelementptr inbounds i32, i32* %arraydecay5, i64 0 ; <i32*> [#uses=1]
57   %tmp7 = load i32* %arrayidx6                    ; <i32> [#uses=1]
58   %cmp8 = icmp eq i32 %tmp7, -2                   ; <i1> [#uses=1]
59   br i1 %cmp8, label %if.then, label %if.else
61 if.then:                                          ; preds = %for.end
62   br label %return
64 if.else:                                          ; preds = %for.end
65   br label %return
67 return:                                           ; preds = %if.else, %if.then
68   %retval.0 = phi i32 [ 0, %if.then ], [ 1, %if.else ] ; <i32> [#uses=1]
69   ret i32 %retval.0
72 ; CHECK:for (c2=0;