1 ; RUN: opt %loadPolly -polly-parallel -polly-parallel-force -polly-print-ast -disable-output < %s | FileCheck %s -check-prefix=AST
2 ; RUN: opt %loadPolly -polly-parallel -polly-parallel-force -polly-codegen -S < %s | FileCheck %s -check-prefix=IR
4 ; Make sure we correctly forward the reference to 'A' to the OpenMP subfunction.
6 ; void loop_references_outer_ids(float *A) {
7 ; for (long i = 0; i < 100; i++)
13 ; AST: #pragma omp parallel for
14 ; AST: for (int c0 = 0; c0 <= 99; c0 += 1)
15 ; AST: Stmt_for_body(c0);
17 ; IR-LABEL: polly.parallel.for:
18 ; IR-NEXT: %polly.subfn.storeaddr.A = getelementptr inbounds { ptr }, ptr %polly.par.userContext, i32 0, i32 0
19 ; IR-NEXT: store ptr %A, ptr %polly.subfn.storeaddr.A
21 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
23 define void @loop_references_outer_ids(ptr %A) {
27 for.cond: ; preds = %for.inc, %entry
28 %i.0 = phi i64 [ 0, %entry ], [ %inc, %for.inc ]
29 %exitcond = icmp ne i64 %i.0, 100
30 br i1 %exitcond, label %for.body, label %for.end
32 for.body: ; preds = %for.cond
33 %conv = sitofp i64 %i.0 to float
34 %arrayidx = getelementptr inbounds float, ptr %A, i64 %i.0
35 store float %conv, ptr %arrayidx, align 4
38 for.inc: ; preds = %for.body
39 %inc = add nsw i64 %i.0, 1
42 for.end: ; preds = %for.cond