1 // RUN: %libomp-compile-and-run
2 #include <stdio.h>
3 #include "omp_testsuite.h"
4 
test_omp_get_num_devices()5 int test_omp_get_num_devices()
6 {
7   /* checks that omp_get_device_num */
8   int num_devices = omp_get_num_devices();
9 
10   return (num_devices == 0);
11 }
12 
main()13 int main()
14 {
15   int i;
16   int num_failed=0;
17 
18   for(i = 0; i < REPETITIONS; i++) {
19     if(!test_omp_get_num_devices()) {
20       num_failed++;
21     }
22   }
23   return num_failed;
24 }
25