[Mlir-commits] [mlir] [mlir][emitc] Fix creating pointer from constant array (PR #162083)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Mon Dec 22 00:29:16 PST 2025


================
@@ -1,5 +1,11 @@
 // RUN: mlir-translate -mlir-to-cpp %s | FileCheck %s -check-prefix=CPP-DEFAULT
 // RUN: mlir-translate -mlir-to-cpp -declare-variables-at-top %s | FileCheck %s -check-prefix=CPP-DECLTOP
+// check that the generated code is syntactically valid
+// RUN: mlir-translate -mlir-to-cpp %s | %host_cxx -fsyntax-only -x c++ -
----------------
Jimmy2027 wrote:

I think it would be nice to have checks that verify that the generated C code actually compiles, to catch bugs like the one this PR aims to fix. The emitC doc mentions gcc and clang but probably testing one should be enough

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


More information about the Mlir-commits mailing list