[OpenMP] Enable previously successful offloading tests.
Create a separate test file to contain all tests for OpenMP
offloading to GPUs.
Make libdevice checking more robust by accounting for
the case in which no libdevice is found.
This changes are in connrection with diff: D29660
llvm-svn: 310718
diff --git a/clang/lib/Driver/ToolChains/Cuda.cpp b/clang/lib/Driver/ToolChains/Cuda.cpp
index 00715a7..49a2302 100644
--- a/clang/lib/Driver/ToolChains/Cuda.cpp
+++ b/clang/lib/Driver/ToolChains/Cuda.cpp
@@ -153,6 +153,19 @@
}
}
+ // This code prevents IsValid from being set when
+ // no libdevice has been found.
+ bool allEmpty = true;
+ std::string LibDeviceFile;
+ for (auto key : LibDeviceMap.keys()) {
+ LibDeviceFile = LibDeviceMap.lookup(key);
+ if (!LibDeviceFile.empty())
+ allEmpty = false;
+ }
+
+ if (allEmpty)
+ continue;
+
IsValid = true;
break;
}