PR c++/86342 - -Wdeprecated-copy and system headers.
[official-gcc.git] / libgomp / testsuite / libgomp.oacc-c-c++-common / lib-86.c
blobb8a8ee94a5856dfb60da119c07c7a7e3d0b9c1c4
1 /* { dg-do run } */
3 #include <stdlib.h>
4 #include <unistd.h>
5 #include <openacc.h>
7 int
8 main (int argc, char **argv)
10 if (acc_get_num_devices (acc_device_nvidia) == 0)
11 return 0;
13 if (acc_get_current_cuda_device () != 0)
14 abort ();
16 acc_init (acc_device_host);
18 if (acc_get_current_cuda_device () != 0)
19 abort ();
21 acc_shutdown (acc_device_host);
23 if (acc_get_num_devices (acc_device_nvidia) == 0)
24 return 0;
26 if (acc_get_current_cuda_device () != 0)
27 abort ();
29 acc_init (acc_device_nvidia);
31 if (acc_get_current_cuda_device () == 0)
32 abort ();
34 acc_shutdown (acc_device_nvidia);
36 if (acc_get_current_cuda_device () != 0)
37 abort ();
39 return 0;
42 /* { dg-output "" } */