diff --git a/clang/lib/CodeGen/CGStmtOpenMP.cpp b/clang/lib/CodeGen/CGStmtOpenMP.cpp index 6eca0a5ccab41..a4e80a4a9e1fd 100644 --- a/clang/lib/CodeGen/CGStmtOpenMP.cpp +++ b/clang/lib/CodeGen/CGStmtOpenMP.cpp @@ -8064,7 +8064,8 @@ void CodeGenFunction::EmitSimpleOMPExecutableDirective( D.getDirectiveKind() == OMPD_critical || D.getDirectiveKind() == OMPD_section || D.getDirectiveKind() == OMPD_master || - D.getDirectiveKind() == OMPD_masked) { + D.getDirectiveKind() == OMPD_masked || + D.getDirectiveKind() == OMPD_unroll) { EmitStmt(D.getAssociatedStmt()); } else { auto LPCRegion = diff --git a/clang/test/OpenMP/bug63570.c b/clang/test/OpenMP/bug63570.c new file mode 100644 index 0000000000000..f61a2ee49b388 --- /dev/null +++ b/clang/test/OpenMP/bug63570.c @@ -0,0 +1,10 @@ +// RUN: %clang_cc1 -verify -fopenmp -x c -triple x86_64-apple-darwin10 %s +// RUN: %clang_cc1 -verify -fopenmp-simd -x c -triple x86_64-apple-darwin10 %s +// expected-no-diagnostics + +void f(float *a, float *b) { +#pragma omp unroll + for (int i = 0; i < 128; i++) { + a[i] = b[i]; + } +}