[Mlir-commits] [mlir] [mlir][emitc] Don't emit extra semicolon after bracket (PR #122464)

Kirill Chibisov llvmlistbot at llvm.org
Mon Jan 13 04:37:07 PST 2025


================
@@ -0,0 +1,18 @@
+// RUN: mlir-translate -mlir-to-cpp %s | FileCheck %s
+// RUN: mlir-translate -mlir-to-cpp -declare-variables-at-top %s | FileCheck %s
+
+func.func @no_extra_semicolon(%arg0: i1) {
+  emitc.if %arg0 {
+    emitc.if %arg0 {
+    }
+    emitc.verbatim "return;"
+  }
----------------
kchibisov wrote:

The point though is how you write them, since accounting for all the permutations of where the for/switch/etc is is a bit noisy, so I wrote in a more of a regression test style, where I've noticed the issue.

I'll add a full line matching in the tests where those are used already, so it'll probably help with regressions.


>I think there is FileCheck command line args or syntax to enforce full line matching.

Thanks, I completely forgot about it, have to pass the match full lines flag.

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


More information about the Mlir-commits mailing list