Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/c-c++-common/goacc/cache-2.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 /* OpenACC cache directive: invalid usage. */ | |
2 | |
3 int | |
4 main (int argc, char **argv) | |
5 { | |
6 #define N 2 | |
7 int a[N], b[N]; | |
8 int i; | |
9 | |
10 for (i = 0; i < N; i++) | |
11 { | |
12 a[i] = 3; | |
13 b[i] = 0; | |
14 } | |
15 | |
16 #pragma acc parallel copyin (a[0:N]) copyout (b[0:N]) | |
17 { | |
18 int ii; | |
19 | |
20 for (ii = 0; ii < N; ii++) | |
21 { | |
22 const int idx = ii; | |
23 int n = 1; | |
24 const int len = n; | |
25 | |
26 #pragma acc cache /* { dg-error "expected '\\\(' before end of line" } */ | |
27 #pragma acc cache a[0:N] /* { dg-error "expected '\\\(' before 'a'" } */ | |
28 /* { dg-bogus "expected end of line before 'a'" "" { xfail c++ } .-1 } */ | |
29 #pragma acc cache (a) /* { dg-error "expected '\\\['" } */ | |
30 #pragma acc cache ( /* { dg-error "expected (identifier|unqualified-id) before end of line" } */ | |
31 #pragma acc cache () /* { dg-error "expected (identifier|unqualified-id) before '\\\)' token" } */ | |
32 #pragma acc cache (,) /* { dg-error "expected (identifier|unqualified-id) before '(,|\\\))' token" } */ | |
33 #pragma acc cache (a[0:N] /* { dg-error "expected '\\\)' before end of line" } */ | |
34 #pragma acc cache (a[0:N],) /* { dg-error "expected (identifier|unqualified-id) before '(,|\\\))' token" "" { xfail c } } */ | |
35 #pragma acc cache (a[0:N]) copyin (a[0:N]) /* { dg-error "expected end of line before 'copyin'" } */ | |
36 #pragma acc cache () /* { dg-error "expected (identifier|unqualified-id) before '\\\)' token" } */ | |
37 #pragma acc cache (a[0:N] b[0:N]) /* { dg-error "expected '\\\)' before 'b'" } */ | |
38 #pragma acc cache (a[0:N] b[0:N}) /* { dg-error "expected '\\\)' before 'b'" } */ | |
39 /* { dg-bogus "expected end of line before '\\\}' token" "" { xfail c++ } .-1 } */ | |
40 #pragma acc cache (a[0:N] /* { dg-error "expected '\\\)' before end of line" } */ | |
41 #pragma acc cache (a[0:N]) ( /* { dg-error "expected end of line before '\\(' token" } */ | |
42 #pragma acc cache (a[0:N]) ii /* { dg-error "expected end of line before 'ii'" } */ | |
43 #pragma acc cache (a[0:N] ii) /* { dg-error "expected '\\)' before 'ii'" } */ | |
44 | |
45 b[ii] = a[ii]; | |
46 } | |
47 } | |
48 | |
49 | |
50 for (i = 0; i < N; i++) | |
51 { | |
52 if (a[i] != b[i]) | |
53 __builtin_abort (); | |
54 } | |
55 | |
56 return 0; | |
57 } |