]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/c-c++-common/goacc/kernels-loop-nest.c
Use plain -fopenacc to enable OpenACC kernels processing
[thirdparty/gcc.git] / gcc / testsuite / c-c++-common / goacc / kernels-loop-nest.c
CommitLineData
40e26f94 1/* { dg-additional-options "-O2" } */
40e26f94
TV
2/* { dg-additional-options "-fdump-tree-parloops1-all" } */
3/* { dg-additional-options "-fdump-tree-optimized" } */
4
5/* Based on autopar/outer-1.c. */
6
7#include <stdlib.h>
8
9#define N 1000
10
11int
12main (void)
13{
14 int x[N][N];
15
16#pragma acc kernels copyout (x)
17 {
18 for (int ii = 0; ii < N; ii++)
19 for (int jj = 0; jj < N; jj++)
20 x[ii][jj] = ii + jj + 3;
21 }
22
23 for (int i = 0; i < N; i++)
24 for (int j = 0; j < N; j++)
25 if (x[i][j] != i + j + 3)
26 abort ();
27
28 return 0;
29}
30
31/* Check that only one loop is analyzed, and that it can be parallelized. */
32/* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 1 "parloops1" } } */
33/* { dg-final { scan-tree-dump-not "FAILED:" "parloops1" } } */
34
35/* Check that the loop has been split off into a function. */
36/* { dg-final { scan-tree-dump-times "(?n);; Function .*main._omp_fn.0" 1 "optimized" } } */
37
f99c3557 38/* { dg-final { scan-tree-dump-times "(?n)oacc function \\(0," 1 "parloops1" } } */