diff options
Diffstat (limited to 'test/OpenMP/nesting_of_regions.cpp')
-rw-r--r-- | test/OpenMP/nesting_of_regions.cpp | 883 |
1 files changed, 883 insertions, 0 deletions
diff --git a/test/OpenMP/nesting_of_regions.cpp b/test/OpenMP/nesting_of_regions.cpp index a97505b1c3c16..9b3a2b39be52a 100644 --- a/test/OpenMP/nesting_of_regions.cpp +++ b/test/OpenMP/nesting_of_regions.cpp @@ -202,6 +202,12 @@ void foo() { for (int i = 0; i < 10; ++i) ; } +#pragma omp parallel + { +#pragma omp target teams distribute parallel for simd // OK + for (int i = 0; i < 10; ++i) + ; + } // SIMD DIRECTIVE #pragma omp simd @@ -441,6 +447,12 @@ void foo() { for (int j = 0; j < 10; ++j) ; } +#pragma omp simd + for (int i = 0; i < 10; ++i) { +#pragma omp target teams distribute parallel for simd // expected-error {{OpenMP constructs may not be nested inside a simd region}} + for (int j = 0; j < 10; ++j) + ; + } // FOR DIRECTIVE #pragma omp for @@ -693,6 +705,12 @@ void foo() { for (int j = 0; j < 10; ++j) ; } +#pragma omp for + for (int i = 0; i < 10; ++i) { +#pragma omp target teams distribute parallel for simd // OK + for (int j = 0; j < 10; ++j) + ; + } // FOR SIMD DIRECTIVE #pragma omp for simd @@ -933,6 +951,12 @@ void foo() { for (int j = 0; j < 10; ++j) ; } +#pragma omp for simd + for (int i = 0; i < 10; ++i) { +#pragma omp target teams distribute parallel for simd // expected-error {{OpenMP constructs may not be nested inside a simd region}} + for (int j = 0; j < 10; ++j) + ; + } // SECTIONS DIRECTIVE #pragma omp sections @@ -1190,6 +1214,12 @@ void foo() { for (int i = 0; i < 10; ++i) ; } +#pragma omp sections + { +#pragma omp target teams distribute parallel for simd // OK + for (int i = 0; i < 10; ++i) + ; + } // SECTION DIRECTIVE #pragma omp section // expected-error {{orphaned 'omp section' directives are prohibited, it must be closely nested to a sections region}} @@ -1512,6 +1542,13 @@ void foo() { for (int i = 0; i < 10; ++i) ; } +#pragma omp sections + { +#pragma omp section +#pragma omp target teams distribute parallel for simd // OK + for (int i = 0; i < 10; ++i) + ; + } // SINGLE DIRECTIVE #pragma omp single @@ -1755,6 +1792,12 @@ void foo() { for (int i = 0; i < 10; ++i) ; } +#pragma omp single + { +#pragma omp target teams distribute parallel for simd // OK + for (int i = 0; i < 10; ++i) + ; + } // MASTER DIRECTIVE #pragma omp master @@ -1998,6 +2041,12 @@ void foo() { for (int i = 0; i < 10; ++i) ; } +#pragma omp master + { +#pragma omp target teams distribute parallel for simd // OK + for (int i = 0; i < 10; ++i) + ; + } // CRITICAL DIRECTIVE #pragma omp critical @@ -2255,6 +2304,12 @@ void foo() { for (int i = 0; i < 10; ++i) ; } +#pragma omp critical + { +#pragma omp target teams distribute parallel for simd // OK + for (int i = 0; i < 10; ++i) + ; + } // PARALLEL FOR DIRECTIVE #pragma omp parallel for @@ -2512,6 +2567,12 @@ void foo() { for (int j = 0; j < 10; ++j) ; } +#pragma omp parallel for + for (int i = 0; i < 10; ++i) { +#pragma omp target teams distribute parallel for simd // OK + for (int j = 0; j < 10; ++j) + ; + } // PARALLEL FOR SIMD DIRECTIVE #pragma omp parallel for simd @@ -2770,6 +2831,12 @@ void foo() { for (int j = 0; j < 10; ++j) ; } +#pragma omp parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp target teams distribute parallel for simd // expected-error {{OpenMP constructs may not be nested inside a simd region}} + for (int j = 0; j < 10; ++j) + ; + } // PARALLEL SECTIONS DIRECTIVE #pragma omp parallel sections @@ -3016,6 +3083,12 @@ void foo() { for (int i = 0; i < 10; ++i) ; } +#pragma omp parallel sections + { +#pragma omp target teams distribute parallel for simd // OK + for (int i = 0; i < 10; ++i) + ; + } // TASK DIRECTIVE #pragma omp task @@ -3209,6 +3282,12 @@ void foo() { for (int i = 0; i < 10; ++i) ; } +#pragma omp task + { +#pragma omp target teams distribute parallel for simd // OK + for (int i = 0; i < 10; ++i) + ; + } // ORDERED DIRECTIVE #pragma omp ordered @@ -3473,6 +3552,12 @@ void foo() { for (int i = 0; i < 10; ++i) ; } +#pragma omp ordered + { +#pragma omp target teams distribute parallel for simd // OK + for (int i = 0; i < 10; ++i) + ; + } // ATOMIC DIRECTIVE #pragma omp atomic @@ -3781,6 +3866,14 @@ void foo() { for (int i = 0; i < 10; ++i) ; } +#pragma omp atomic + // expected-error@+2 {{the statement for 'atomic' must be an expression statement of form '++x;', '--x;', 'x++;', 'x--;', 'x binop= expr;', 'x = x binop expr' or 'x = expr binop x', where x is an l-value expression with scalar type}} + // expected-note@+1 {{expected an expression statement}} + { +#pragma omp target teams distribute parallel for simd // expected-error {{OpenMP constructs may not be nested inside an atomic region}} + for (int i = 0; i < 10; ++i) + ; + } // TARGET DIRECTIVE #pragma omp target @@ -3991,6 +4084,12 @@ void foo() { for (int i = 0; i < 10; ++i) ; } +#pragma omp target + { +#pragma omp target teams distribute parallel for simd // expected-error {{region cannot be nested inside 'target' region}} + for (int i = 0; i < 10; ++i) + ; + } // TARGET PARALLEL DIRECTIVE #pragma omp target parallel @@ -4194,6 +4293,12 @@ void foo() { for (int i = 0; i < 10; ++i) ; } +#pragma omp target parallel + { +#pragma omp target teams distribute parallel for simd // expected-error {{region cannot be nested inside 'target parallel' region}} + for (int i = 0; i < 10; ++i) + ; + } // TARGET PARALLEL FOR DIRECTIVE #pragma omp target parallel for @@ -4451,6 +4556,12 @@ void foo() { for (int j = 0; j < 10; ++j) ; } +#pragma omp target parallel for + for (int i = 0; i < 10; ++i) { +#pragma omp target teams distribute parallel for simd // expected-error {{region cannot be nested inside 'target parallel for' region}} + for (int j = 0; j < 10; ++j) + ; + } // TEAMS DIRECTIVE #pragma omp teams // expected-error {{orphaned 'omp teams' directives are prohibited; perhaps you forget to enclose the directive into a target region?}} @@ -4706,6 +4817,13 @@ void foo() { for (int i = 0; i < 10; ++i) ; } +#pragma omp target +#pragma omp teams + { +#pragma omp target teams distribute parallel for simd // expected-error {{region cannot be nested inside 'target' region}} + for (int i = 0; i < 10; ++i) + ; + } // TASKLOOP DIRECTIVE #pragma omp taskloop @@ -4954,6 +5072,12 @@ void foo() { for (int j = 0; j < 10; ++j) ++a; } +#pragma omp taskloop + for (int i = 0; i < 10; ++i) { +#pragma omp target teams distribute parallel for simd // OK + for (int j = 0; j < 10; ++j) + ++a; + } // DISTRIBUTE DIRECTIVE #pragma omp target @@ -5242,6 +5366,14 @@ void foo() { for (int j = 0; j < 10; ++j) ; } +#pragma omp target +#pragma omp teams +#pragma omp distribute + for (int i = 0; i < 10; ++i) { +#pragma omp target teams distribute parallel for simd // expected-error {{region cannot be nested inside 'target' region}} + for (int j = 0; j < 10; ++j) + ; + } // DISTRIBUTE PARALLEL FOR DIRECTIVE #pragma omp target @@ -5538,6 +5670,14 @@ void foo() { for (int i = 0; i < 10; ++i) ; } +#pragma omp target +#pragma omp teams +#pragma omp distribute parallel for + for (int i = 0; i < 10; ++i) { +#pragma omp target teams distribute parallel for simd // expected-error {{region cannot be nested inside 'target' region}} + for (int i = 0; i < 10; ++i) + ; + } // DISTRIBUTE PARALLEL FOR SIMD DIRECTIVE #pragma omp target @@ -5842,6 +5982,14 @@ void foo() { for (int i = 0; i < 10; ++i) ++a; } +#pragma omp target +#pragma omp teams +#pragma omp distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp target teams distribute parallel for simd // expected-error {{OpenMP constructs may not be nested inside a simd region}} + for (int i = 0; i < 10; ++i) + ++a; + } // TARGET SIMD DIRECTIVE #pragma omp target simd @@ -6053,6 +6201,12 @@ void foo() { for (int i = 0; i < 10; ++i) ++a; } +#pragma omp target simd + for (int i = 0; i < 10; ++i) { +#pragma omp target teams distribute parallel for simd // expected-error {{OpenMP constructs may not be nested inside a simd region}} + for (int i = 0; i < 10; ++i) + ++a; + } // TEAMS DISTRIBUTE DIRECTIVE #pragma omp teams distribute // expected-error {{orphaned 'omp teams distribute' directives are prohibited; perhaps you forget to enclose the directive into a target region?}} @@ -6302,6 +6456,13 @@ void foo() { for (int i = 0; i < 10; ++i) ++a; } +#pragma omp target +#pragma omp teams distribute + for (int i = 0; i < 10; ++i) { +#pragma omp target teams distribute parallel for simd // expected-error {{region cannot be nested inside 'target' region}} + for (int i = 0; i < 10; ++i) + ++a; + } // TEAMS DISTRIBUTE DIRECTIVE #pragma omp teams distribute // expected-error {{orphaned 'omp teams distribute' directives are prohibited; perhaps you forget to enclose the directive into a target region?}} @@ -6571,6 +6732,13 @@ void foo() { for (int i = 0; i < 10; ++i) ++a; } +#pragma omp target +#pragma omp teams distribute + for (int i = 0; i < 10; ++i) { +#pragma omp target teams distribute parallel for simd // expected-error {{region cannot be nested inside 'target' region}} + for (int i = 0; i < 10; ++i) + ++a; + } // TEAMS DISTRIBUTE SIMD DIRECTIVE #pragma omp teams distribute simd // expected-error {{orphaned 'omp teams distribute simd' directives are prohibited; perhaps you forget to enclose the directive into a target region?}} @@ -6840,6 +7008,13 @@ void foo() { for (int i = 0; i < 10; ++i) ++a; } +#pragma omp target +#pragma omp teams distribute simd + for (int i = 0; i < 10; ++i) { +#pragma omp target teams distribute parallel for simd // expected-error {{OpenMP constructs may not be nested inside a simd region}} + for (int i = 0; i < 10; ++i) + ++a; + } // TEAMS DISTRIBUTE PARALLEL FOR SIMD DIRECTIVE #pragma omp teams distribute parallel for simd // expected-error {{orphaned 'omp teams distribute parallel for simd' directives are prohibited; perhaps you forget to enclose the directive into a target region?}} @@ -7109,6 +7284,13 @@ void foo() { for (int i = 0; i < 10; ++i) ++a; } +#pragma omp target +#pragma omp teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp target teams distribute parallel for simd // expected-error {{OpenMP constructs may not be nested inside a simd region}} + for (int i = 0; i < 10; ++i) + ++a; + } // TEAMS DISTRIBUTE PARALLEL FOR DIRECTIVE #pragma omp teams distribute parallel for // expected-error {{orphaned 'omp teams distribute parallel for' directives are prohibited; perhaps you forget to enclose the directive into a target region?}} @@ -7378,6 +7560,13 @@ void foo() { for (int i = 0; i < 10; ++i) ++a; } +#pragma omp target +#pragma omp teams distribute parallel for + for (int i = 0; i < 10; ++i) { +#pragma omp target teams distribute parallel for simd // expected-error {{region cannot be nested inside 'target' region}} + for (int i = 0; i < 10; ++i) + ++a; + } // TARGET TEAMS DIRECTIVE #pragma omp target teams @@ -7587,6 +7776,12 @@ void foo() { for (int i = 0; i < 10; ++i) ; } +#pragma omp target teams + { +#pragma omp target teams distribute parallel for simd // expected-error {{region cannot be nested inside 'target teams' region}} + for (int i = 0; i < 10; ++i) + ; + } // TARGET TEAMS DISTRIBUTE DIRECTIVE #pragma omp target teams distribute // OK @@ -7818,6 +8013,12 @@ void foo() { for (int i = 0; i < 10; ++i) ; } +#pragma omp target teams distribute + for (int i = 0; i < 10; ++i) { +#pragma omp target teams distribute parallel for simd // expected-error {{region cannot be nested inside 'target teams distribute' region}} + for (int i = 0; i < 10; ++i) + ; + } // TARGET TEAMS DISTRIBUTE PARALLEL FOR DIRECTIVE #pragma omp target teams distribute parallel for // OK @@ -8049,6 +8250,249 @@ void foo() { for (int i = 0; i < 10; ++i) ; } +#pragma omp target teams distribute parallel for + for (int i = 0; i < 10; ++i) { +#pragma omp target teams distribute parallel for simd // expected-error {{region cannot be nested inside 'target teams distribute parallel for' region}} + for (int i = 0; i < 10; ++i) + ; + } + +// TARGET TEAMS DISTRIBUTE PARALLEL FOR SIMD DIRECTIVE +#pragma omp target teams distribute parallel for simd // OK + for (int i = 0; i < 10; ++i) + ; +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp distribute parallel for simd // expected-error {{OpenMP constructs may not be nested inside a simd region}} + for (int i = 0; i < 10; ++i) + ; + } +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp distribute // expected-error {{OpenMP constructs may not be nested inside a simd region}} + for (int i = 0; i < 10; ++i) + ; + } +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp for // expected-error {{OpenMP constructs may not be nested inside a simd region}} + for (int i = 0; i < 10; ++i) + ; + } +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp simd // expected-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}} + for (int i = 0; i < 10; ++i) + ; + } +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp for simd // expected-error {{OpenMP constructs may not be nested inside a simd region}} + for (int i = 0; i < 10; ++i) + ; + } +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp parallel // expected-error {{OpenMP constructs may not be nested inside a simd region}} + for (int i = 0; i < 10; ++i) + ; + } +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp sections // expected-error {{OpenMP constructs may not be nested inside a simd region}} + { + bar(); + } + } +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp section // expected-error {{OpenMP constructs may not be nested inside a simd region}} + { + bar(); + } + } +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp single // expected-error {{OpenMP constructs may not be nested inside a simd region}} + { + bar(); + } + } +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp master // expected-error {{OpenMP constructs may not be nested inside a simd region}} + { + bar(); + } + } +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp critical // expected-error {{OpenMP constructs may not be nested inside a simd region}} + { + bar(); + } + } +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp parallel // expected-error {{OpenMP constructs may not be nested inside a simd region}} + { +#pragma omp single + { + bar(); + } + } + } +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp parallel for // expected-error {{OpenMP constructs may not be nested inside a simd region}} + for (int i = 0; i < 10; ++i) + ; + } +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp parallel for simd // expected-error {{OpenMP constructs may not be nested inside a simd region}} + for (int i = 0; i < 10; ++i) + ; + } +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp parallel sections // expected-error {{OpenMP constructs may not be nested inside a simd region}} + { + bar(); + } + } +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp task // expected-error {{OpenMP constructs may not be nested inside a simd region}} + { + bar(); + } + } +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp taskyield // expected-error {{OpenMP constructs may not be nested inside a simd region}} + bar(); + } +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp barrier // expected-error {{OpenMP constructs may not be nested inside a simd region}} + bar(); + } +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp taskwait // expected-error {{OpenMP constructs may not be nested inside a simd region}} + bar(); + } +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp flush // expected-error {{OpenMP constructs may not be nested inside a simd region}} + bar(); + } +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp ordered // expected-error {{OpenMP constructs may not be nested inside a simd region}} + bar(); + } +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp atomic // expected-error {{OpenMP constructs may not be nested inside a simd region}}OK + ++a; + } +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp target // expected-error {{OpenMP constructs may not be nested inside a simd region}} + ++a; + } +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp target parallel // expected-error {{OpenMP constructs may not be nested inside a simd region}} + ++a; + } +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp target parallel for // expected-error {{OpenMP constructs may not be nested inside a simd region}} + for (int i = 0; i < 10; ++i) + ; + } +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp target enter data map(to: a) // expected-error {{OpenMP constructs may not be nested inside a simd region}} + ++a; + } +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp target exit data map(from: a) // expected-error {{OpenMP constructs may not be nested inside a simd region}} + ++a; + } +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp teams // expected-error {{OpenMP constructs may not be nested inside a simd region}} + ++a; + } +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp target update to(a) // expected-error {{OpenMP constructs may not be nested inside a simd region}} + ++a; + } +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp distribute simd // expected-error {{OpenMP constructs may not be nested inside a simd region}} + for (int i = 0; i < 10; ++i) + ++a; + } +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp target simd // expected-error {{OpenMP constructs may not be nested inside a simd region}} + for (int i = 0; i < 10; ++i) + ++a; + } +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp teams distribute // expected-error {{OpenMP constructs may not be nested inside a simd region}} + for (int i = 0; i < 10; ++i) + ++a; + } +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp teams distribute simd // expected-error {{OpenMP constructs may not be nested inside a simd region}} + for (int i = 0; i < 10; ++i) + ++a; + } +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp teams distribute parallel for simd // expected-error {{OpenMP constructs may not be nested inside a simd region}} + for (int i = 0; i < 10; ++i) + ++a; + } +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp teams distribute parallel for // expected-error {{OpenMP constructs may not be nested inside a simd region}} + for (int i = 0; i < 10; ++i) + ; + } +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp target teams // expected-error {{OpenMP constructs may not be nested inside a simd region}} + a++; + } +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp target teams distribute // expected-error {{OpenMP constructs may not be nested inside a simd region}} + for (int i = 0; i < 10; ++i) + ; + } +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp target teams distribute parallel for // expected-error {{OpenMP constructs may not be nested inside a simd region}} + for (int i = 0; i < 10; ++i) + ; + } +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp target teams distribute parallel for simd // expected-error {{OpenMP constructs may not be nested inside a simd region}} + for (int i = 0; i < 10; ++i) + ; + } } @@ -8250,6 +8694,12 @@ void foo() { for (int i = 0; i < 10; ++i) ; } +#pragma omp parallel + { +#pragma omp target teams distribute parallel for simd // OK + for (int i = 0; i < 10; ++i) + ; + } // SIMD DIRECTIVE #pragma omp simd @@ -8473,6 +8923,12 @@ void foo() { for (int j = 0; j < 10; ++j) ; } +#pragma omp simd + for (int i = 0; i < 10; ++i) { +#pragma omp target teams distribute parallel for simd // expected-error {{OpenMP constructs may not be nested inside a simd region}} + for (int j = 0; j < 10; ++j) + ; + } // FOR DIRECTIVE #pragma omp for @@ -8716,6 +9172,12 @@ void foo() { for (int j = 0; j < 10; ++j) ; } +#pragma omp for + for (int i = 0; i < 10; ++i) { +#pragma omp target teams distribute parallel for simd // OK + for (int j = 0; j < 10; ++j) + ; + } // FOR SIMD DIRECTIVE #pragma omp for simd @@ -8939,6 +9401,12 @@ void foo() { for (int j = 0; j < 10; ++j) ; } +#pragma omp for simd + for (int i = 0; i < 10; ++i) { +#pragma omp target teams distribute parallel for simd // expected-error {{OpenMP constructs may not be nested inside a simd region}} + for (int j = 0; j < 10; ++j) + ; + } // SECTIONS DIRECTIVE #pragma omp sections @@ -9171,6 +9639,12 @@ void foo() { for (int i = 0; i < 10; ++i) ; } +#pragma omp sections + { +#pragma omp target teams distribute parallel for simd // OK + for (int i = 0; i < 10; ++i) + ; + } // SECTION DIRECTIVE #pragma omp section // expected-error {{orphaned 'omp section' directives are prohibited, it must be closely nested to a sections region}} @@ -9503,6 +9977,13 @@ void foo() { for (int i = 0; i < 10; ++i) ; } +#pragma omp sections + { +#pragma omp section +#pragma omp target teams distribute parallel for simd // OK + for (int i = 0; i < 10; ++i) + ; + } // SINGLE DIRECTIVE #pragma omp single @@ -9736,6 +10217,12 @@ void foo() { for (int i = 0; i < 10; ++i) ; } +#pragma omp single + { +#pragma omp target teams distribute parallel for simd // OK + for (int i = 0; i < 10; ++i) + ; + } // MASTER DIRECTIVE #pragma omp master @@ -9979,6 +10466,12 @@ void foo() { for (int i = 0; i < 10; ++i) ; } +#pragma omp master + { +#pragma omp target teams distribute parallel for simd // OK + for (int i = 0; i < 10; ++i) + ; + } // CRITICAL DIRECTIVE #pragma omp critical @@ -10241,6 +10734,12 @@ void foo() { for (int i = 0; i < 10; ++i) ; } +#pragma omp critical + { +#pragma omp target teams distribute parallel for simd // OK + for (int i = 0; i < 10; ++i) + ; + } // PARALLEL FOR DIRECTIVE #pragma omp parallel for @@ -10499,6 +10998,12 @@ void foo() { for (int j = 0; j < 10; ++j) ; } +#pragma omp parallel for + for (int i = 0; i < 10; ++i) { +#pragma omp target teams distribute parallel for simd // OK + for (int j = 0; j < 10; ++j) + ; + } // PARALLEL FOR SIMD DIRECTIVE #pragma omp parallel for simd @@ -10757,6 +11262,12 @@ void foo() { for (int j = 0; j < 10; ++j) ; } +#pragma omp parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp target teams distribute parallel for simd // expected-error {{OpenMP constructs may not be nested inside a simd region}} + for (int j = 0; j < 10; ++j) + ; + } // PARALLEL SECTIONS DIRECTIVE #pragma omp parallel sections @@ -10999,6 +11510,12 @@ void foo() { for (int i = 0; i < 10; ++i) ; } +#pragma omp parallel sections + { +#pragma omp target teams distribute parallel for simd // OK + for (int i = 0; i < 10; ++i) + ; + } // TASK DIRECTIVE #pragma omp task @@ -11191,6 +11708,12 @@ void foo() { for (int i = 0; i < 10; ++i) ; } +#pragma omp task + { +#pragma omp target teams distribute parallel for simd // OK + for (int i = 0; i < 10; ++i) + ; + } // ATOMIC DIRECTIVE #pragma omp atomic @@ -11498,6 +12021,14 @@ void foo() { for (int i = 0; i < 10; ++i) ; } +#pragma omp atomic + // expected-error@+2 {{the statement for 'atomic' must be an expression statement of form '++x;', '--x;', 'x++;', 'x--;', 'x binop= expr;', 'x = x binop expr' or 'x = expr binop x', where x is an l-value expression with scalar type}} + // expected-note@+1 {{expected an expression statement}} + { +#pragma omp target teams distribute parallel for simd // expected-error {{OpenMP constructs may not be nested inside an atomic region}} + for (int i = 0; i < 10; ++i) + ; + } // TARGET DIRECTIVE #pragma omp target @@ -11704,6 +12235,12 @@ void foo() { for (int i = 0; i < 10; ++i) ; } +#pragma omp target + { +#pragma omp target teams distribute parallel for simd // expected-error {{region cannot be nested inside 'target' region}} + for (int i = 0; i < 10; ++i) + ; + } // TARGET PARALLEL DIRECTIVE #pragma omp target parallel @@ -11907,6 +12444,12 @@ void foo() { for (int i = 0; i < 10; ++i) ; } +#pragma omp target parallel + { +#pragma omp target teams distribute parallel for simd // expected-error {{region cannot be nested inside 'target parallel' region}} + for (int i = 0; i < 10; ++i) + ; + } // TARGET PARALLEL FOR DIRECTIVE #pragma omp target parallel for @@ -12165,6 +12708,12 @@ void foo() { for (int j = 0; j < 10; ++j) ; } +#pragma omp target parallel for + for (int i = 0; i < 10; ++i) { +#pragma omp target teams distribute parallel for simd // expected-error {{region cannot be nested inside 'target parallel for' region}} + for (int j = 0; j < 10; ++j) + ; + } // TEAMS DIRECTIVE #pragma omp target @@ -12422,6 +12971,13 @@ void foo() { for (int i = 0; i < 10; ++i) ; } +#pragma omp target +#pragma omp teams + { +#pragma omp target teams distribute parallel for simd // expected-error {{region cannot be nested inside 'target' region}} + for (int i = 0; i < 10; ++i) + ; + } // TASKLOOP DIRECTIVE #pragma omp taskloop @@ -12670,6 +13226,12 @@ void foo() { for (int i = 0; i < 10; ++i) ; } +#pragma omp taskloop + for (int i = 0; i < 10; ++i) { +#pragma omp target teams distribute parallel for simd // OK + for (int i = 0; i < 10; ++i) + ; + } // DISTRIBUTE DIRECTIVE #pragma omp target @@ -12967,6 +13529,14 @@ void foo() { for (int i = 0; i < 10; ++i) ++a; } +#pragma omp target +#pragma omp teams +#pragma omp distribute + for (int i = 0; i < 10; ++i) { +#pragma omp target teams distribute parallel for simd // expected-error {{region cannot be nested inside 'target' region}} + for (int i = 0; i < 10; ++i) + ++a; + } // DISTRIBUTE PARALLEL FOR DIRECTIVE #pragma omp target @@ -13272,6 +13842,14 @@ void foo() { for (int i = 0; i < 10; ++i) ++a; } +#pragma omp target +#pragma omp teams +#pragma omp distribute parallel for + for (int i = 0; i < 10; ++i) { +#pragma omp target teams distribute parallel for simd // expected-error {{region cannot be nested inside 'target' region}} + for (int i = 0; i < 10; ++i) + ++a; + } // DISTRIBUTE PARALLEL FOR SIMD DIRECTIVE #pragma omp target @@ -13568,6 +14146,14 @@ void foo() { for (int i = 0; i < 10; ++i) ; } +#pragma omp target +#pragma omp teams +#pragma omp distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp target teams distribute parallel for simd // expected-error {{OpenMP constructs may not be nested inside a simd region}} + for (int i = 0; i < 10; ++i) + ; + } // DISTRIBUTE SIMD DIRECTIVE #pragma omp target @@ -13864,6 +14450,14 @@ void foo() { for (int i = 0; i < 10; ++i) ; } +#pragma omp target +#pragma omp teams +#pragma omp distribute simd + for (int i = 0; i < 10; ++i) { +#pragma omp target teams distribute parallel for simd // expected-error {{OpenMP constructs may not be nested inside a simd region}} + for (int i = 0; i < 10; ++i) + ; + } // TARGET SIMD DIRECTIVE #pragma omp target simd @@ -14086,6 +14680,12 @@ void foo() { for (int i = 0; i < 10; ++i) ; } +#pragma omp target simd + for (int i = 0; i < 10; ++i) { +#pragma omp target teams distribute parallel for simd // expected-error {{OpenMP constructs may not be nested inside a simd region}} + for (int i = 0; i < 10; ++i) + ; + } // TEAMS DISTRIBUTE DIRECTIVE #pragma omp teams distribute // expected-error {{orphaned 'omp teams distribute' directives are prohibited; perhaps you forget to enclose the directive into a target region?}} @@ -14355,6 +14955,13 @@ void foo() { for (int i = 0; i < 10; ++i) ++a; } +#pragma omp target +#pragma omp teams distribute + for (int i = 0; i < 10; ++i) { +#pragma omp target teams distribute parallel for simd // expected-error {{region cannot be nested inside 'target' region}} + for (int i = 0; i < 10; ++i) + ++a; + } // TEAMS DISTRIBUTE SIMD DIRECTIVE #pragma omp teams distribute simd // expected-error {{orphaned 'omp teams distribute simd' directives are prohibited; perhaps you forget to enclose the directive into a target region?}} @@ -14624,6 +15231,13 @@ void foo() { for (int i = 0; i < 10; ++i) ++a; } +#pragma omp target +#pragma omp teams distribute simd + for (int i = 0; i < 10; ++i) { +#pragma omp target teams distribute parallel for simd // expected-error {{OpenMP constructs may not be nested inside a simd region}} + for (int i = 0; i < 10; ++i) + ++a; + } // TEAMS DISTRIBUTE PARALLEL FOR SIMD DIRECTIVE #pragma omp teams distribute parallel for simd // expected-error {{orphaned 'omp teams distribute parallel for simd' directives are prohibited; perhaps you forget to enclose the directive into a target region?}} @@ -14893,6 +15507,13 @@ void foo() { for (int i = 0; i < 10; ++i) ++a; } +#pragma omp target +#pragma omp teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp target teams distribute parallel for simd // expected-error {{OpenMP constructs may not be nested inside a simd region}} + for (int i = 0; i < 10; ++i) + ++a; + } // TEAMS DISTRIBUTE PARALLEL FOR DIRECTIVE #pragma omp teams distribute parallel for // expected-error {{orphaned 'omp teams distribute parallel for' directives are prohibited; perhaps you forget to enclose the directive into a target region?}} @@ -15162,6 +15783,13 @@ void foo() { for (int i = 0; i < 10; ++i) ++a; } +#pragma omp target +#pragma omp teams distribute parallel for + for (int i = 0; i < 10; ++i) { +#pragma omp target teams distribute parallel for simd // expected-error {{region cannot be nested inside 'target' region}} + for (int i = 0; i < 10; ++i) + ++a; + } // TARGET TEAMS DIRECTIVE #pragma omp target teams @@ -15371,6 +15999,12 @@ void foo() { for (int i = 0; i < 10; ++i) ; } +#pragma omp target teams + { +#pragma omp target teams distribute parallel for simd // expected-error {{region cannot be nested inside 'target teams' region}} + for (int i = 0; i < 10; ++i) + ; + } // TARGET TEAMS DISTRIBUTE DIRECTIVE #pragma omp target teams distribute // OK @@ -15602,6 +16236,12 @@ void foo() { for (int i = 0; i < 10; ++i) ++a; } +#pragma omp target teams distribute + for (int i = 0; i < 10; ++i) { +#pragma omp target teams distribute parallel for simd // expected-error {{region cannot be nested inside 'target teams distribute' region}} + for (int i = 0; i < 10; ++i) + ++a; + } // TARGET TEAMS DISTRIBUTE PARALLEL FOR DIRECTIVE #pragma omp target teams distribute parallel for // OK @@ -15833,7 +16473,250 @@ void foo() { for (int i = 0; i < 10; ++i) ++a; } +#pragma omp target teams distribute parallel for + for (int i = 0; i < 10; ++i) { +#pragma omp target teams distribute parallel for simd // expected-error {{region cannot be nested inside 'target teams distribute parallel for' region}} + for (int i = 0; i < 10; ++i) + ++a; + } +// TARGET TEAMS DISTRIBUTE PARALLEL FOR SIMD DIRECTIVE +#pragma omp target teams distribute parallel for simd // OK + for (int i = 0; i < 10; ++i) + ; +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp distribute parallel for simd // expected-error {{OpenMP constructs may not be nested inside a simd region}} + for (int i = 0; i < 10; ++i) + ; + } +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp distribute // expected-error {{OpenMP constructs may not be nested inside a simd region}} + for (int i = 0; i < 10; ++i) + ; + } +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp for // expected-error {{OpenMP constructs may not be nested inside a simd region}} + for (int i = 0; i < 10; ++i) + ; + } +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp simd // expected-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}} + for (int i = 0; i < 10; ++i) + ; + } +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp for simd // expected-error {{OpenMP constructs may not be nested inside a simd region}} + for (int i = 0; i < 10; ++i) + ; + } +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp parallel // expected-error {{OpenMP constructs may not be nested inside a simd region}} + for (int i = 0; i < 10; ++i) + ; + } +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp sections // expected-error {{OpenMP constructs may not be nested inside a simd region}} + { + bar(); + } + } +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp section // expected-error {{OpenMP constructs may not be nested inside a simd region}} + { + bar(); + } + } +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp single // expected-error {{OpenMP constructs may not be nested inside a simd region}} + { + bar(); + } + } +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp master // expected-error {{OpenMP constructs may not be nested inside a simd region}} + { + bar(); + } + } +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp critical // expected-error {{OpenMP constructs may not be nested inside a simd region}} + { + bar(); + } + } +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp parallel // expected-error {{OpenMP constructs may not be nested inside a simd region}} + { +#pragma omp single + { + bar(); + } + } + } +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp parallel for // expected-error {{OpenMP constructs may not be nested inside a simd region}} + for (int i = 0; i < 10; ++i) + ; + } +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp parallel for simd // expected-error {{OpenMP constructs may not be nested inside a simd region}} + for (int i = 0; i < 10; ++i) + ; + } +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp parallel sections // expected-error {{OpenMP constructs may not be nested inside a simd region}} + { + bar(); + } + } +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp task // expected-error {{OpenMP constructs may not be nested inside a simd region}} + { + bar(); + } + } +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp taskyield // expected-error {{OpenMP constructs may not be nested inside a simd region}} + bar(); + } +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp barrier // expected-error {{OpenMP constructs may not be nested inside a simd region}} + bar(); + } +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp taskwait // expected-error {{OpenMP constructs may not be nested inside a simd region}} + bar(); + } +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp flush // expected-error {{OpenMP constructs may not be nested inside a simd region}} + bar(); + } +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp ordered // expected-error {{OpenMP constructs may not be nested inside a simd region}} + bar(); + } +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp atomic // expected-error {{OpenMP constructs may not be nested inside a simd region}}OK + ++a; + } +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp target // expected-error {{OpenMP constructs may not be nested inside a simd region}} + ++a; + } +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp target parallel // expected-error {{OpenMP constructs may not be nested inside a simd region}} + ++a; + } +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp target parallel for // expected-error {{OpenMP constructs may not be nested inside a simd region}} + for (int i = 0; i < 10; ++i) + ; + } +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp target enter data map(to: a) // expected-error {{OpenMP constructs may not be nested inside a simd region}} + ++a; + } +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp target exit data map(from: a) // expected-error {{OpenMP constructs may not be nested inside a simd region}} + ++a; + } +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp teams // expected-error {{OpenMP constructs may not be nested inside a simd region}} + ++a; + } +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp target update to(a) // expected-error {{OpenMP constructs may not be nested inside a simd region}} + ++a; + } +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp distribute simd // expected-error {{OpenMP constructs may not be nested inside a simd region}} + for (int i = 0; i < 10; ++i) + ++a; + } +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp target simd // expected-error {{OpenMP constructs may not be nested inside a simd region}} + for (int i = 0; i < 10; ++i) + ++a; + } +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp teams distribute // expected-error {{OpenMP constructs may not be nested inside a simd region}} + for (int i = 0; i < 10; ++i) + ++a; + } +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp teams distribute simd // expected-error {{OpenMP constructs may not be nested inside a simd region}} + for (int i = 0; i < 10; ++i) + ++a; + } +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp teams distribute parallel for simd // expected-error {{OpenMP constructs may not be nested inside a simd region}} + for (int i = 0; i < 10; ++i) + ++a; + } +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp teams distribute parallel for // expected-error {{OpenMP constructs may not be nested inside a simd region}} + for (int i = 0; i < 10; ++i) + ; + } +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp target teams // expected-error {{OpenMP constructs may not be nested inside a simd region}} + a++; + } +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp target teams distribute // expected-error {{OpenMP constructs may not be nested inside a simd region}} + for (int i = 0; i < 10; ++i) + ; + } +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp target teams distribute parallel for // expected-error {{OpenMP constructs may not be nested inside a simd region}} + for (int i = 0; i < 10; ++i) + ; + } +#pragma omp target teams distribute parallel for simd + for (int i = 0; i < 10; ++i) { +#pragma omp target teams distribute parallel for simd // expected-error {{OpenMP constructs may not be nested inside a simd region}} + for (int i = 0; i < 10; ++i) + ; + } + return foo<int>(); } |