]> git.ipfire.org Git - thirdparty/gcc.git/blob - libgomp/testsuite/libgomp.oacc-c-c++-common/lib-5.c
Merge current set of OpenACC changes from gomp-4_0-branch.
[thirdparty/gcc.git] / libgomp / testsuite / libgomp.oacc-c-c++-common / lib-5.c
1 /* { dg-do run } */
2
3 #include <stdlib.h>
4 #include <openacc.h>
5
6 int
7 main (int argc, char **argv)
8 {
9 if (acc_get_device_type () == acc_device_default)
10 abort ();
11
12 acc_init (acc_device_default);
13
14 if (acc_get_device_type () == acc_device_default)
15 abort ();
16
17 acc_shutdown (acc_device_default);
18
19 if (acc_get_num_devices (acc_device_nvidia) != 0)
20 {
21 acc_init (acc_device_nvidia);
22
23 if (acc_get_device_type () != acc_device_nvidia)
24 abort ();
25
26 acc_shutdown (acc_device_nvidia);
27
28 acc_init (acc_device_default);
29
30 acc_set_device_type (acc_device_nvidia);
31
32 if (acc_get_device_type () != acc_device_nvidia)
33 abort ();
34
35 acc_shutdown (acc_device_nvidia);
36 }
37
38 return 0;
39
40 }