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
32 lines
712 B
C
32 lines
712 B
C
// RUN: %libomptarget-compile-generic -DSHARED -fPIC -shared -o %t.so && %clang %flags %s -o %t -ldl && %libomptarget-run-generic %t.so 2>&1 | %fcheck-generic
|
|
|
|
#ifdef SHARED
|
|
#include <stdio.h>
|
|
int foo() {
|
|
#pragma omp target
|
|
;
|
|
printf("%s\n", "DONE.");
|
|
return 0;
|
|
}
|
|
#else
|
|
#include <dlfcn.h>
|
|
#include <stdio.h>
|
|
int main(int argc, char **argv) {
|
|
void *Handle = dlopen(argv[1], RTLD_NOW);
|
|
int (*Foo)(void);
|
|
|
|
if (Handle == NULL) {
|
|
printf("dlopen() failed: %s\n", dlerror());
|
|
return 1;
|
|
}
|
|
Foo = (int (*)(void)) dlsym(Handle, "foo");
|
|
if (Handle == NULL) {
|
|
printf("dlsym() failed: %s\n", dlerror());
|
|
return 1;
|
|
}
|
|
// CHECK: DONE.
|
|
// CHECK-NOT: {{abort|fault}}
|
|
return Foo();
|
|
}
|
|
#endif
|