This patch fuses the RUN lines for most libomptarget tests. The previous patch D101315 created separate test targets for each supported offloading triple. This patch updates the RUN lines in libomptarget tests to use a generic run line independent of the offloading target selected for the lit instance. In cases, where no RUN line was defined for a specific offloading target, the corresponding target is declared as XFAIL. If it turns out that a test actually supports the target, the XFAIL line can be removed. Differential Revision: https://reviews.llvm.org/D101326
21 lines
426 B
C++
21 lines
426 B
C++
// RUN: %libomptarget-compilexx-run-and-check-generic
|
|
|
|
#include <stdio.h>
|
|
#include <omp.h>
|
|
|
|
int main(void) {
|
|
int isHost = 0;
|
|
|
|
#pragma omp target map(from: isHost)
|
|
{ isHost = omp_is_initial_device(); }
|
|
|
|
if (isHost < 0) {
|
|
printf("Runtime error, isHost=%d\n", isHost);
|
|
}
|
|
|
|
// CHECK: Target region executed on the device
|
|
printf("Target region executed on the %s\n", isHost ? "host" : "device");
|
|
|
|
return isHost;
|
|
}
|