77 lines · plain
1; RUN: opt %loadNPMPolly '-passes=polly-custom<ast>' -polly-print-ast -disable-output < %s | FileCheck %s2; XFAIL: *3 4;define N 205;#include "limits.h"6;int A[N];7;8;void bar (int n) {9; int i;10; __sync_synchronize();11; i = 0;12;13; do {14; A[0] = i;15; ++i;16; } while (i < 2 * n);17; __sync_synchronize();18;}19;20;int main () {21; A[0] = 0;22; bar (N/2);23;24; if (A[0] == N - 1 )25; return 0;26; else27; 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 32@A = common global [20 x i32] zeroinitializer, align 4 ; <ptr> [#uses=1]33 34define void @bar(i32 %n) nounwind {35entry:36 fence seq_cst37 %tmp = mul i32 %n, 2 ; <i32> [#uses=2]38 %tmp1 = icmp sgt i32 %tmp, 1 ; <i1> [#uses=1]39 %smax = select i1 %tmp1, i32 %tmp, i32 1 ; <i32> [#uses=1]40 br label %do.body41 42do.body: ; preds = %do.cond, %entry43 %0 = phi i32 [ 0, %entry ], [ %inc, %do.cond ] ; <i32> [#uses=2]44 store i32 %0, ptr @A45 %inc = add nsw i32 %0, 1 ; <i32> [#uses=2]46 br label %do.cond47 48do.cond: ; preds = %do.body49 %exitcond = icmp ne i32 %inc, %smax ; <i1> [#uses=1]50 br i1 %exitcond, label %do.body, label %do.end51 52do.end: ; preds = %do.cond53 fence seq_cst54 ret void55}56 57define i32 @main() nounwind {58entry:59 store i32 0, ptr @A60 call void @bar(i32 10)61 %tmp = load i32, ptr @A ; <i32> [#uses=1]62 %cmp = icmp eq i32 %tmp, 19 ; <i1> [#uses=1]63 br i1 %cmp, label %if.then, label %if.else64 65if.then: ; preds = %entry66 br label %return67 68if.else: ; preds = %entry69 br label %return70 71return: ; preds = %if.else, %if.then72 %retval.0 = phi i32 [ 0, %if.then ], [ 1, %if.else ] ; <i32> [#uses=1]73 ret i32 %retval.074}75; CHECK: Scop: do.body => do.end76 77