[PR testsuite/65205] Fix dg-shouldfail usage in OpenACC libgomp tests
[official-gcc.git] / libgomp / testsuite / libgomp.oacc-c-c++-common / lib-65.c
blob0f2f9ebe4fdb1d9870b020067b561d95eb02cc86
1 /* { dg-do run { target openacc_nvidia_accel_selected } } */
3 #include <string.h>
4 #include <stdlib.h>
5 #include <openacc.h>
7 int
8 main (int argc, char **argv)
10 const int N = 256;
11 int i;
12 unsigned char *h;
13 void *d;
15 h = (unsigned char *) malloc (N);
17 for (i = 0; i < N; i++)
19 h[i] = i;
22 d = acc_malloc (N);
24 acc_memcpy_to_device (d, d, N);
26 memset (&h[0], 0, N);
28 acc_memcpy_from_device (h, d, N);
30 for (i = 0; i < N; i++)
32 if (h[i] != i)
33 abort ();
36 acc_free (d);
38 free (h);
40 return 0;
43 /* { dg-output "invalid host or device address" } */
44 /* { dg-shouldfail "" } */