Debian Codegraph @

gcc/testsuite/gcc.dg/gomp/bad-array-section-c-7.c

raw
1 /* { dg-do compile } */
2
3 int x;
4
5 struct T {
6 int arr[20];
7 };
8
9 struct S {
10 struct T *tvec;
11 };
12
13 int main()
14 {
15 struct S *s;
16 /* You can't use an array section like this. Make sure sensible errors are
17 reported. */
18 #pragma omp target map(s->tvec[3:5].arr[0:20])
19 /* { dg-error {'\(struct T \*\)&s->tvec\[3:5\]' is a pointer; did you mean to use '->'\?} "" { target *-*-* } .-1 } */
20 { }
21 #pragma omp target map(s->tvec[5:x].arr[0:20])
22 /* { dg-error {'\(struct T \*\)&s->tvec\[5:x\]' is a pointer; did you mean to use '->'\?} "" { target *-*-* } .-1 } */
23 { }
24
25 return 0;
26 }