Fix type compatibility for types with flexible array member 2/2 [PR113688,PR114713...
[gcc.git] / libgomp / testsuite / libgomp.oacc-c-c++-common / lib-34.c
blob8ddd897826ffa0f00ef7769c6f7df374b6a884d1
1 /* Exercise an invalid acc_present_or_create. */
3 /* { dg-skip-if "" { *-*-* } { "*" } { "-DACC_MEM_SHARED=0" } } */
5 #include <stdio.h>
6 #include <stdlib.h>
7 #include <openacc.h>
9 int
10 main (int argc, char **argv)
12 const int N = 256;
13 unsigned char *h;
14 void *d1, *d2;
16 h = (unsigned char *) malloc (N);
18 d1 = acc_present_or_create (h, N);
19 if (!d1)
20 abort ();
22 fprintf (stderr, "CheCKpOInT\n");
23 d2 = acc_present_or_create (h + 2, N);
24 if (!d2)
25 abort ();
27 if (d1 != d2)
28 abort ();
30 acc_delete (h, N);
32 free (h);
34 return 0;
37 /* { dg-output "CheCKpOInT(\n|\r\n|\r).*" } */
38 /* { dg-output "\\\[\[0-9a-fA-FxX\]+,\\\+256\\\] not mapped" } */
39 /* { dg-shouldfail "" } */