xref: /llvm-project/offload/test/api/omp_get_num_devices_with_empty_target.c (revision 330d8983d25d08580fc1642fea48b2473f47a9da)
1 // RUN: %libomptarget-compile-run-and-check-generic
2 
3 #include <omp.h>
4 #include <stdio.h>
5 
test_omp_get_num_devices_with_empty_target()6 static int test_omp_get_num_devices_with_empty_target() {
7   /* checks that omp_get_num_devices() > 0 */
8   return omp_get_num_devices() > 0;
9 }
10 
main()11 int main() {
12   int failed = 0;
13 
14   if (!test_omp_get_num_devices_with_empty_target()) {
15     ++failed;
16   }
17 
18   if (failed) {
19     printf("FAIL\n");
20   } else {
21     printf("PASS\n");
22   }
23 
24   return failed;
25 }
26 
27 // CHECK: PASS
28