From c93fb143b98ea2035c6fca95241bc5ba40faf97e Mon Sep 17 00:00:00 2001 From: Joachim Protze Date: Mon, 18 Oct 2021 13:33:22 +0200 Subject: [PATCH] [OpenMP][Tests][NFC] Work around ICC bug Older intel compilers miss the privatization of nested loop variables for doacross loops. Declaring the variable in the loop makes the test more robust. --- openmp/runtime/test/ompt/synchronization/ordered_dependences.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/openmp/runtime/test/ompt/synchronization/ordered_dependences.c b/openmp/runtime/test/ompt/synchronization/ordered_dependences.c index dc9f082..c3c6471 100644 --- a/openmp/runtime/test/ompt/synchronization/ordered_dependences.c +++ b/openmp/runtime/test/ompt/synchronization/ordered_dependences.c @@ -6,11 +6,10 @@ int main() { int a[10][10]; - int i, j; #pragma omp parallel num_threads(2) #pragma omp for ordered(2) - for (i = 0; i < 2; i++) - for (j = 0; j < 2; j++) { + for (int i = 0; i < 2; i++) + for (int j = 0; j < 2; j++) { a[i][j] = i + j + 1; printf("%d, %d\n", i, j); #pragma omp ordered depend(sink : i - 1, j) depend(sink : i, j - 1) -- 2.7.4