mirror of
https://github.com/OpenMP/Examples.git
synced 2025-04-10 16:32:11 +01:00
24 lines
433 B
C
24 lines
433 B
C
/*
|
|
* @@name: array_sections.2
|
|
* @@type: C
|
|
* @@operation: compile
|
|
* @@expect: ct-error
|
|
* @@version: omp_4.0
|
|
*/
|
|
void foo ()
|
|
{
|
|
int A[30], *p;
|
|
#pragma omp target data map( A[0:4] )
|
|
{
|
|
p = &A[0];
|
|
/* invalid because p[3] and A[3] are the same
|
|
* location on the host but the array section
|
|
* specified via p[...] is not a subset of A[0:4] */
|
|
#pragma omp target map( p[3:20] )
|
|
{
|
|
A[2] = 0;
|
|
p[8] = 0;
|
|
}
|
|
}
|
|
}
|