Summary: The static linking test ensures that we can statically link offloading programs. To create the test we used `llvm-ar`. However, this may not exist in the user's environment. This patch changes it to use the binutils `ar` which should exist on every system running these tests currently. In the future we should set up the dependencies properly.
30 lines
553 B
C
30 lines
553 B
C
// RUN: %libomptarget-compile-generic -DLIBRARY -c -o %t.o
|
|
// RUN: ar rcs %t.a %t.o
|
|
// RUN: %libomptarget-compile-generic %t.a && %libomptarget-run-generic 2>&1 | %fcheck-generic
|
|
|
|
// UNSUPPORTED: nvptx64-nvidia-cuda-oldDriver
|
|
// UNSUPPORTED: amdgcn-amd-amdhsa-oldDriver
|
|
|
|
#ifdef LIBRARY
|
|
int x = 42;
|
|
#pragma omp declare target(x)
|
|
|
|
int foo() {
|
|
int value;
|
|
#pragma omp target map(from : value)
|
|
value = x;
|
|
return value;
|
|
}
|
|
#else
|
|
#include <stdio.h>
|
|
int foo();
|
|
|
|
int main() {
|
|
int x = foo();
|
|
|
|
// CHECK: PASS
|
|
if (x == 42)
|
|
printf("PASS\n");
|
|
}
|
|
#endif
|