| 1 |
/* { dg-do compile } */ |
| 2 |
|
| 3 |
struct S { |
| 4 |
signed char *ptr; |
| 5 |
}; |
| 6 |
|
| 7 |
int main() |
| 8 |
{ |
| 9 |
signed char arr[20]; |
| 10 |
|
| 11 |
/* Reject array section in compound initialiser. */ |
| 12 |
#pragma omp target map( (struct S) { .ptr = (signed char *) arr[5:5] } ) |
| 13 |
/* { dg-error {expected '\]' before ':' token} "" { target *-*-* } .-1 } */ |
| 14 |
/* { dg-warning {cast to pointer from integer of different size} "" { target *-*-* } .-2 } */ |
| 15 |
/* { dg-message {sorry, unimplemented: unsupported map expression} "" { target *-*-* } .-3 } */ |
| 16 |
{ } |
| 17 |
|
| 18 |
/* ...and this is unsupported too (probably not useful anyway). */ |
| 19 |
#pragma omp target map( (struct S) { .ptr = &arr[5] } ) |
| 20 |
/* { dg-message {sorry, unimplemented: unsupported map expression} "" { target *-*-* } .-1 } */ |
| 21 |
{ } |
| 22 |
|
| 23 |
return 0; |
| 24 |
} |