* ubsan.c (ubsan_expand_null_ifn): Use _v1 suffixed type mismatch
[official-gcc.git] / gcc / testsuite / c-c++-common / goacc / classify-kernels.c
blob95037e6120ea5372d56eb52738536d05ad5cefb2
1 /* Check offloaded function's attributes and classification for OpenACC
2 kernels. */
4 /* { dg-additional-options "-O2" }
5 { dg-additional-options "-fdump-tree-ompexp" }
6 { dg-additional-options "-fdump-tree-parloops1-all" }
7 { dg-additional-options "-fdump-tree-oaccdevlow" } */
9 #define N 1024
11 extern unsigned int *__restrict a;
12 extern unsigned int *__restrict b;
13 extern unsigned int *__restrict c;
15 void KERNELS ()
17 #pragma acc kernels copyin (a[0:N], b[0:N]) copyout (c[0:N])
18 for (unsigned int i = 0; i < N; i++)
19 c[i] = a[i] + b[i];
22 /* Check the offloaded function's attributes.
23 { dg-final { scan-tree-dump-times "(?n)__attribute__\\(\\(oacc kernels, omp target entrypoint\\)\\)" 1 "ompexp" } } */
25 /* Check that exactly one OpenACC kernels construct is analyzed, and that it
26 can be parallelized.
27 { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 1 "parloops1" } }
28 { dg-final { scan-tree-dump-times "(?n)__attribute__\\(\\(oacc kernels parallelized, oacc function \\(, , \\), oacc kernels, omp target entrypoint\\)\\)" 1 "parloops1" } }
29 { dg-final { scan-tree-dump-not "FAILED:" "parloops1" } } */
31 /* Check the offloaded function's classification and compute dimensions (will
32 always be 1 x 1 x 1 for non-offloading compilation).
33 { dg-final { scan-tree-dump-times "(?n)Function is parallelized OpenACC kernels offload" 1 "oaccdevlow" } }
34 { dg-final { scan-tree-dump-times "(?n)Compute dimensions \\\[1, 1, 1\\\]" 1 "oaccdevlow" } }
35 { dg-final { scan-tree-dump-times "(?n)__attribute__\\(\\(oacc function \\(1, 1, 1\\), oacc kernels parallelized, oacc function \\(, , \\), oacc kernels, omp target entrypoint\\)\\)" 1 "oaccdevlow" } } */