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
30 lines
940 B
C
30 lines
940 B
C
// RUN: %libomptarget-compile-run-and-check-generic
|
|
|
|
#include <stdio.h>
|
|
|
|
// OpenMP 5.1, sec. 2.21.7.1 "map Clause", p. 351 L14-16:
|
|
// "If the map clause appears on a target, target data, or target exit data
|
|
// construct and a corresponding list item of the original list item is not
|
|
// present in the device data environment on exit from the region then the
|
|
// list item is ignored."
|
|
|
|
int main(void) {
|
|
int f = 5, r = 6, d = 7, af = 8;
|
|
|
|
// Check exit from omp target data.
|
|
// CHECK: f = 5, af = 8
|
|
#pragma omp target data map(from: f) map(always, from: af)
|
|
{
|
|
#pragma omp target exit data map(delete: f, af)
|
|
}
|
|
printf("f = %d, af = %d\n", f, af);
|
|
|
|
// Check omp target exit data.
|
|
// CHECK: f = 5, r = 6, d = 7, af = 8
|
|
#pragma omp target exit data map(from: f) map(release: r) map(delete: d) \
|
|
map(always, from: af)
|
|
printf("f = %d, r = %d, d = %d, af = %d\n", f, r, d, af);
|
|
|
|
return 0;
|
|
}
|