Bump version to 19.1.0-rc3
[llvm-project.git] / offload / test / api / omp_get_num_devices.c
blobe8fbdcd1a1de0a5387fc435e86fa24042fe51247
1 // RUN: %libomptarget-compile-run-and-check-generic
3 #include <omp.h>
4 #include <stdio.h>
6 int test_omp_get_num_devices() {
7 /* checks that omp_get_num_devices() > 0 */
8 int num_devices = omp_get_num_devices();
9 printf("num_devices = %d\n", num_devices);
11 #pragma omp target
14 return (num_devices > 0);
17 int main() {
18 int i;
19 int failed = 0;
21 if (!test_omp_get_num_devices()) {
22 failed++;
24 if (failed)
25 printf("FAIL\n");
26 else
27 printf("PASS\n");
28 return failed;
31 // CHECK: PASS