1; RUN: opt %loadPolly -polly-ast -S -analyze  < %s | FileCheck %s
2; XFAIL: *
3
4;#define N 20
5;#include "limits.h"
6;
7;int main () {
8;  int i;
9;  int A[N];
10;
11;  A[0] = 1;
12;
13;  __sync_synchronize();
14;
15;  i = 0;
16;
17;  do {
18;    A[0] = 0;
19;    ++i;
20;  } while (i < 1);
21;
22;  __sync_synchronize();
23;
24;  if (A[0] == 0)
25;    return 0;
26;  else
27;    return 1;
28;}
29
30target 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"
31
32define i32 @main() nounwind {
33entry:
34  %A = alloca [20 x i32], align 4                 ; <[20 x i32]*> [#uses=3]
35  %arraydecay = getelementptr inbounds [20 x i32], [20 x i32]* %A, i32 0, i32 0 ; <i32*> [#uses=1]
36  %arrayidx = getelementptr inbounds i32, i32* %arraydecay, i64 0 ; <i32*> [#uses=1]
37  store i32 1, i32* %arrayidx
38  fence seq_cst
39  br label %do.body
40
41do.body:                                          ; preds = %do.cond, %entry
42  %arraydecay1 = getelementptr inbounds [20 x i32], [20 x i32]* %A, i32 0, i32 0 ; <i32*> [#uses=1]
43  %arrayidx2 = getelementptr inbounds i32, i32* %arraydecay1, i64 0 ; <i32*> [#uses=1]
44  store i32 0, i32* %arrayidx2
45  br label %do.cond
46
47do.cond:                                          ; preds = %do.body
48  br i1 false, label %do.body, label %do.end
49
50do.end:                                           ; preds = %do.cond
51  fence seq_cst
52  %arraydecay4 = getelementptr inbounds [20 x i32], [20 x i32]* %A, i32 0, i32 0 ; <i32*> [#uses=1]
53  %arrayidx5 = getelementptr inbounds i32, i32* %arraydecay4, i64 0 ; <i32*> [#uses=1]
54  %tmp6 = load i32, i32* %arrayidx5                    ; <i32> [#uses=1]
55  %cmp7 = icmp eq i32 %tmp6, 0                    ; <i1> [#uses=1]
56  br i1 %cmp7, label %if.then, label %if.else
57
58if.then:                                          ; preds = %do.end
59  br label %return
60
61if.else:                                          ; preds = %do.end
62  br label %return
63
64return:                                           ; preds = %if.else, %if.then
65  %retval.0 = phi i32 [ 0, %if.then ], [ 1, %if.else ] ; <i32> [#uses=1]
66  ret i32 %retval.0
67}
68
69; CHECK: S0(0)
70