Files
clang-p2996/openmp/libomptarget/test/offloading/global_constructor.cpp
Jon Chesterfield 4d50803ce4 [libomptarget] Build DeviceRTL for amdgpu
Passes same tests as the current deviceRTL. Includes cmake change from D111987.
CI is showing a different set of pass/fails to local, committing this
without the tests enabled by default while debugging that difference.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D112227
2021-10-28 12:34:01 +01:00

24 lines
527 B
C++

// RUN: %libomptarget-compilexx-generic && %libomptarget-run-generic | %fcheck-generic
// Fails in DAGToDAG on an address space problem
// UNSUPPORTED: amdgcn-amd-amdhsa
// UNSUPPORTED: amdgcn-amd-amdhsa-newRTL
#include <cmath>
#include <cstdio>
const double Host = log(2.0) / log(2.0);
#pragma omp declare target
const double Device = log(2.0) / log(2.0);
#pragma omp end declare target
int main() {
double X;
#pragma omp target map(from : X)
{ X = Device; }
// CHECK: PASS
if (X == Host)
printf("PASS\n");
}