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

llvmlistbot at llvm.org llvmlistbot at llvm.org
Wed Oct 18 17:15:04 PDT 2023


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-mlir-llvm

Author: Stella Stamenova (sstamenova)

<details>
<summary>Changes</summary>

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

---
Full diff: https://github.com/llvm/llvm-project/pull/69538.diff


1 Files Affected:

- (modified) mlir/unittests/Target/LLVM/SerializeToLLVMBitcode.cpp (+1-1) 


``````````diff
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();

``````````

</details>


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


More information about the Mlir-commits mailing list