libstdc++: Fix _Atomic(T) macro in <stdatomic.h> [PR115807]
[official-gcc.git] / libgomp / testsuite / libgomp.oacc-c-c++-common / lib-86.c
blob7e8a7e20203fde5f27642c4487a977621378d43f
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_current_cuda_device () != 0)
11 abort ();
13 acc_init (acc_device_host);
15 if (acc_get_current_cuda_device () != 0)
16 abort ();
18 acc_shutdown (acc_device_host);
20 if (acc_get_current_cuda_device () != 0)
21 abort ();
23 if (acc_get_num_devices (acc_device_nvidia))
25 acc_init (acc_device_nvidia);
27 if (acc_get_current_cuda_device () == 0)
28 abort ();
30 acc_shutdown (acc_device_nvidia);
33 if (acc_get_num_devices (acc_device_radeon))
35 acc_init (acc_device_radeon);
37 if (acc_get_current_cuda_device () != 0)
38 abort ();
40 acc_shutdown (acc_device_radeon);
43 if (acc_get_current_cuda_device () != 0)
44 abort ();
46 return 0;
49 /* { dg-output "" } */