Mercurial > hg > CbC > CbC_gcc
annotate libgomp/testsuite/libgomp.oacc-c-c++-common/reduction-initial-1.c @ 143:76e1cf5455ef
add cbc_gc test
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 23 Dec 2018 19:24:05 +0900 |
parents | 04ced10e8804 |
children |
rev | line source |
---|---|
111 | 1 /* { dg-do run } */ |
2 | |
3 int | |
4 main(void) | |
5 { | |
6 #define I 5 | |
7 #define N 32 | |
8 #define A 8 | |
9 | |
10 int a = A; | |
11 int s = I; | |
12 | |
13 #pragma acc parallel vector_length(N) copy(s) | |
14 { | |
15 int i; | |
16 #pragma acc loop reduction(+:s) | |
17 for (i = 0; i < N; ++i) | |
18 s += a; | |
19 } | |
20 | |
21 if (s != I + N * A) | |
22 __builtin_abort(); | |
23 | |
24 return 0; | |
25 } |