]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/c-c++-common/gomp/if-2.c
* builtin-types.def (BT_FN_VOID_BOOL, BT_FN_VOID_SIZE_SIZE_PTR,
[thirdparty/gcc.git] / gcc / testsuite / c-c++-common / gomp / if-2.c
CommitLineData
43895be5 1/* { dg-do compile } */
2/* { dg-options "-fopenmp" } */
3
4void
5foo (int a, int b, int *p, int *q, int task)
6{
7 int i;
8 #pragma omp parallel if (a) if (b) /* { dg-error "too many .if. clauses without modifier" } */
9 ;
10 #pragma omp parallel if (a) if (parallel: b) /* { dg-error "if any .if. clause has modifier, then all .if. clauses have to use modifier" } */
11 ;
12 #pragma omp parallel if (parallel: a) if (b) /* { dg-error "if any .if. clause has modifier, then all .if. clauses have to use modifier" } */
13 ;
14 #pragma omp parallel if (parallel:a) if (parallel:a) /* { dg-error "too many .if. clauses with .parallel. modifier" } */
15 ;
16 #pragma omp parallel if (task:a) /* { dg-error "expected .parallel. .if. clause modifier rather than .task." } */ \
17 if (taskloop: b) /* { dg-error "expected .parallel. .if. clause modifier rather than .taskloop." } */
18 ;
19 #pragma omp parallel if (target update:a) /* { dg-error "expected .parallel. .if. clause modifier rather than .target update." } */
20 ;
7e5a76c8 21 #pragma omp parallel if (cancel:a) /* { dg-error "expected .parallel. .if. clause modifier rather than .cancel." } */
22 ;
43895be5 23 #pragma omp parallel for simd if (target update: a) /* { dg-error "expected .parallel. .if. clause modifier rather than .target update." } */
24 for (i = 0; i < 16; i++)
25 ;
26 #pragma omp task if (task)
27 ;
28 #pragma omp task if (task: task)
29 ;
30 #pragma omp task if (parallel: a) /* { dg-error "expected .task. .if. clause modifier rather than .parallel." } */
31 ;
7e5a76c8 32 #pragma omp simd if (cancel: a) /* { dg-error "expected .simd. .if. clause modifier rather than .cancel." } */
33 for (i = 0; i < 16; i++)
34 ;
43895be5 35 #pragma omp taskloop if (task : a) /* { dg-error "expected .taskloop. .if. clause modifier rather than .task." } */
36 for (i = 0; i < 16; i++)
37 ;
38 #pragma omp target if (taskloop: a) /* { dg-error "expected .target. .if. clause modifier rather than .taskloop." } */
39 ;
7e5a76c8 40 #pragma omp target teams distribute parallel for simd if (target exit data : a) /* { dg-error "expected .target. .if. clause modifier" } */
43895be5 41 for (i = 0; i < 16; i++)
42 ;
43 #pragma omp target data if (target: a) map (p[0:2]) /* { dg-error "expected .target data. .if. clause modifier rather than .target." } */
44 ;
45 #pragma omp target enter data if (target data: a) map (to: p[0:2]) /* { dg-error "expected .target enter data. .if. clause modifier rather than .target data." } */
46 #pragma omp target exit data if (target enter data: a) map (from: p[0:2]) /* { dg-error "expected .target exit data. .if. clause modifier rather than .target enter data." } */
47 #pragma omp target update if (target exit data:a) to (q[0:3]) /* { dg-error "expected .target update. .if. clause modifier rather than .target exit data." } */
7e5a76c8 48 #pragma omp for
49 for (i = 0; i < 16; i++)
50 {
51 #pragma omp cancel for if (target exit data:a) /* { dg-error "expected .cancel. .if. clause modifier" } */
52 }
43895be5 53}