aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/gomp/bad-array-section-c-7.c
blob: 1fd9e2b383a4f76b2ae324aab11e45e5c7d4b98b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/* { dg-do compile } */

int x;

struct T {
  int arr[20];
};

struct S {
  struct T *tvec;
};

int main()
{
  struct S *s;
  /* You can't use an array section like this.  Make sure sensible errors are
     reported.  */
#pragma omp target map(s->tvec[3:5].arr[0:20])
/* { dg-error {'\(struct T \*\)&s->tvec\[3:5\]' is a pointer; did you mean to use '->'\?} "" { target *-*-* } .-1 } */
  { }
#pragma omp target map(s->tvec[5:x].arr[0:20])
/* { dg-error {'\(struct T \*\)&s->tvec\[5:x\]' is a pointer; did you mean to use '->'\?} "" { target *-*-* } .-1 } */
  { }

  return 0;
}