comparison gcc/testsuite/c-c++-common/goacc/combined-reduction.c @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
comparison
equal deleted inserted replaced
68:561a7518be6b 111:04ced10e8804
1 /* { dg-do compile } */
2 /* { dg-options "-fopenacc -fdump-tree-gimple" } */
3
4 #include <assert.h>
5
6 int
7 main ()
8 {
9 int i, v1 = 0, n = 100;
10
11 #pragma acc parallel loop reduction(+:v1)
12 for (i = 0; i < n; i++)
13 v1++;
14
15 assert (v1 == n);
16
17 #pragma acc kernels loop reduction(+:v1)
18 for (i = 0; i < n; i++)
19 v1++;
20
21 assert (v1 == n);
22
23 return 0;
24 }
25
26 /* { dg-final { scan-tree-dump-times "omp target oacc_parallel reduction.+:v1. map.tofrom:v1" 1 "gimple" } } */
27 /* { dg-final { scan-tree-dump-times "acc loop reduction.+:v1. private.i." 1 "gimple" } } */
28 /* { dg-final { scan-tree-dump-times "omp target oacc_kernels map.force_tofrom:n .len: 4.. map.force_tofrom:v1 .len: 4.." 1 "gimple" } } */
29 /* { dg-final { scan-tree-dump-times "acc loop reduction.+:v1. private.i." 1 "gimple" } } */