]>
gcc.gnu.org Git - gcc.git/blob - gcc/testsuite/c-c++-common/goacc/cache-3-2.c
1 /* Test 'cache' directive diagnostics. */
3 /* See also corresponding C++ variant: '../../g++.dg/goacc/cache-3-2.C'. */
5 /* See also corresponding C/C++ data clause variant: 'data-clause-2.c'. */
7 /* The current implementation doesn't restrict where a 'cache' directive may
8 appear, so we don't make any special arrangements. */
11 foo (int *p
, int (*q
)[10], int r
[10], int s
[10][10])
14 #pragma acc cache (p[-1:2])
16 #pragma acc cache (q[-1:2][0:10])
18 #pragma acc cache (q[-1:2][-2:10]) /* { dg-error "negative low bound in array section in" } */
20 #pragma acc cache (r[-1:2])
22 #pragma acc cache (s[-1:2][:])
24 #pragma acc cache (s[-1:2][-2:10]) /* { dg-error "negative low bound in array section in" } */
26 #pragma acc cache (a[-1:2]) /* { dg-error "negative low bound in array section in" } */
28 #pragma acc cache (b[-1:2][0:]) /* { dg-error "negative low bound in array section in" } */
30 #pragma acc cache (b[1:2][-2:10]) /* { dg-error "negative low bound in array section in" } */
32 #pragma acc cache (p[2:-3]) /* { dg-error "negative length in array section in" } */
34 #pragma acc cache (q[2:-3][:]) /* { dg-error "negative length in array section in" } */
36 #pragma acc cache (q[2:3][0:-1]) /* { dg-error "negative length in array section in" } */
38 #pragma acc cache (r[2:-5]) /* { dg-error "negative length in array section in" } */
40 #pragma acc cache (s[2:-5][:]) /* { dg-error "negative length in array section in" } */
42 #pragma acc cache (s[2:5][0:-4]) /* { dg-error "negative length in array section in" } */
44 #pragma acc cache (a[2:-5]) /* { dg-error "negative length in array section in" } */
46 #pragma acc cache (b[2:-5][0:10]) /* { dg-error "negative length in array section in" } */
48 #pragma acc cache (b[2:5][0:-4]) /* { dg-error "negative length in array section in" } */
This page took 0.040938 seconds and 5 git commands to generate.