[Mlir-commits] [mlir] [mlir] Use the process (host) triple in MLIRTargetLLVMTests (PR #69538)

Stella Stamenova llvmlistbot at llvm.org
Wed Oct 18 17:13:56 PDT 2023


https://github.com/sstamenova created https://github.com/llvm/llvm-project/pull/69538

The test is meant to execute on the native target and only initializes the native target. However, it then gets the default target triple instead of the process (host) triple. This fails in cases where the native target and the default target are not the same.

The test was added here: https://reviews.llvm.org/D154100

>From 809cc4ee32e76ed240174d3c48c04415628ab704 Mon Sep 17 00:00:00 2001
From: Stella Stamenova <stilis at microsoft.com>
Date: Wed, 18 Oct 2023 17:11:31 -0700
Subject: [PATCH] Use the process triple not the default target triple

The default target triple might be set to something other than the host while the test is meant to run on the host
---
 mlir/unittests/Target/LLVM/SerializeToLLVMBitcode.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mlir/unittests/Target/LLVM/SerializeToLLVMBitcode.cpp b/mlir/unittests/Target/LLVM/SerializeToLLVMBitcode.cpp
index c23ed7efd72fdf4..69c9d9b2f320202 100644
--- a/mlir/unittests/Target/LLVM/SerializeToLLVMBitcode.cpp
+++ b/mlir/unittests/Target/LLVM/SerializeToLLVMBitcode.cpp
@@ -55,7 +55,7 @@ TEST_F(MLIRTargetLLVM, SKIP_WITHOUT_NATIVE(SerializeToLLVMBitcode)) {
   ASSERT_TRUE(!!module);
 
   // Serialize the module.
-  std::string targetTriple = llvm::sys::getDefaultTargetTriple();
+  std::string targetTriple = llvm::sys::getProcessTriple();
   LLVM::ModuleToObject serializer(*(module->getOperation()), targetTriple, "",
                                   "");
   std::optional<SmallVector<char, 0>> serializedModule = serializer.run();



More information about the Mlir-commits mailing list