brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.4 KiB · 82ec7ff Raw
72 lines · plain
1; RUN: opt %loadNPMPolly '-passes=polly-custom<ast>' -polly-print-ast -disable-output < %s | FileCheck %s2 3;#define N 204;#include "limits.h"5;6;int main () {7;  int i;8;  int A[N];9;10;  A[0] = 0;11;12;  __sync_synchronize();13;14;  for (i = 0; i < INT_MAX; i++)15;    A[0] = i;16;17;  __sync_synchronize();18;19;  if (A[0] == INT_MAX - 1)20;    return 0;21;  else22;    return 1;23;}24 25target 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"26 27define i32 @main() nounwind {28entry:29  %A = alloca [20 x i32], align 4                 ; <ptr> [#uses=3]30  %arraydecay = getelementptr inbounds [20 x i32], ptr %A, i32 0, i32 0 ; <ptr> [#uses=1]31  %arrayidx = getelementptr inbounds i32, ptr %arraydecay, i64 0 ; <ptr> [#uses=1]32  store i32 0, ptr %arrayidx33  fence seq_cst34  br label %for.cond35 36for.cond:                                         ; preds = %for.inc, %entry37  %0 = phi i32 [ 0, %entry ], [ %inc, %for.inc ]  ; <i32> [#uses=3]38  %exitcond = icmp ne i32 %0, 2147483647          ; <i1> [#uses=1]39  br i1 %exitcond, label %for.body, label %for.end40 41for.body:                                         ; preds = %for.cond42  %arraydecay2 = getelementptr inbounds [20 x i32], ptr %A, i32 0, i32 0 ; <ptr> [#uses=1]43  %arrayidx3 = getelementptr inbounds i32, ptr %arraydecay2, i64 0 ; <ptr> [#uses=1]44  store i32 %0, ptr %arrayidx345  br label %for.inc46 47for.inc:                                          ; preds = %for.body48  %inc = add nsw i32 %0, 1                        ; <i32> [#uses=1]49  br label %for.cond50 51for.end:                                          ; preds = %for.cond52  fence seq_cst53  %arraydecay5 = getelementptr inbounds [20 x i32], ptr %A, i32 0, i32 0 ; <ptr> [#uses=1]54  %arrayidx6 = getelementptr inbounds i32, ptr %arraydecay5, i64 0 ; <ptr> [#uses=1]55  %tmp7 = load i32, ptr %arrayidx6                    ; <i32> [#uses=1]56  %cmp8 = icmp eq i32 %tmp7, 2147483646           ; <i1> [#uses=1]57  br i1 %cmp8, label %if.then, label %if.else58 59if.then:                                          ; preds = %for.end60  br label %return61 62if.else:                                          ; preds = %for.end63  br label %return64 65return:                                           ; preds = %if.else, %if.then66  %retval.0 = phi i32 [ 0, %if.then ], [ 1, %if.else ] ; <i32> [#uses=1]67  ret i32 %retval.068}69 70; CHECK: for (int c0 = 0; c0 <= 2147483646; c0 += 1)71; CHECK:   Stmt_for_body(c0);72