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

int x;

int main()
{
  int arr1[40];
  int arr2[40];
#pragma omp target map(arr1[arr2[4:5]:arr2[6:7]])
/* { dg-error {low bound 'arr2\[4:5\]' of array section does not have integral type} "" { target *-*-* } .-1 } */
  { }
#pragma omp target map(arr1[arr2[:1]:arr2[6:1]])
/* { dg-error {low bound 'arr2\[:1\]' of array section does not have integral type} "" { target *-*-* } .-1 } */
  { }
#pragma omp target map(arr1[x:arr2[6:1]])
/* { dg-error {length 'arr2\[6:1\]' of array section does not have integral type} "" { target *-*-* } .-1 } */
  { }

  return 0;
}