================
@@ -123,6 +123,33 @@ TEST(DeviceOffloadBuilderTest, 
MultipleOffloadArchsAreRejected) {
                               "supported. Pass a single --offload-arch"));
 }
 
+TEST(DeviceOffloadHIPTest, DeviceObjectIsGenerated) {
+  llvm::InitializeAllTargets();
+  llvm::InitializeAllTargetMCs();
+  llvm::InitializeAllAsmPrinters();
+  std::string Err;
+  if (!llvm::TargetRegistry::lookupTarget(llvm::Triple("amdgcn-amd-amdhsa"),
+                                          Err))
+    GTEST_SKIP() << Err;
+
+  IncrementalCompilerBuilder CB;
+  CB.SetCompilerArgs({"--offload-arch=gfx1100", "-nogpulib", "-nogpuinc"});
+  auto DeviceCI = CB.CreateDevice(OffloadType::HIP);
+  ASSERT_THAT_EXPECTED(DeviceCI, llvm::Succeeded());
+  auto HostCI = CB.CreateHost(OffloadType::HIP);
+  ASSERT_THAT_EXPECTED(HostCI, llvm::Succeeded());
+  auto Interp = Interpreter::createWithDevice(
+      std::move(*HostCI), std::move(*DeviceCI), OffloadType::HIP);
+  ASSERT_THAT_EXPECTED(Interp, llvm::Succeeded());
+
+  // FIXME: Replace this with a check of the embedded bundle once the offload
----------------
vgvassilev wrote:

Eg, see if #217870 is sufficient for both host and device lit-based tests.

https://github.com/llvm/llvm-project/pull/234498
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to