Files
clang-p2996/openmp/libomptarget/test/api/omp_get_num_devices.c
Joseph Huber 586fc5999b [Libomptarget][NFC] clang-format the libomptarget OpenMP tests
Summary:
Recent changes to clang-format improved the handling of OpenMP pragmas.
Clean up the existing libomptarget tests.
2022-10-19 08:57:27 -05:00

32 lines
510 B
C

// RUN: %libomptarget-compile-run-and-check-generic
#include <omp.h>
#include <stdio.h>
int test_omp_get_num_devices() {
/* checks that omp_get_num_devices() > 0 */
int num_devices = omp_get_num_devices();
printf("num_devices = %d\n", num_devices);
#pragma omp target
{}
return (num_devices > 0);
}
int main() {
int i;
int failed = 0;
if (!test_omp_get_num_devices()) {
failed++;
}
if (failed)
printf("FAIL\n");
else
printf("PASS\n");
return failed;
}
// CHECK: PASS