[clang] [CIR] Upstream a batch of passing tests from CIR-Incubator (PR #157333)
Andy Kaylor via cfe-commits
cfe-commits at lists.llvm.org
Wed Sep 10 12:24:02 PDT 2025
Burhan =?utf-8?b?U8O2xJ/DvHQ=?= <burhan.sogutt at gmail.com>,
Burhan =?utf-8?b?U8O2xJ/DvHQ=?= <burhan.sogutt at gmail.com>,
Burhan =?utf-8?b?U8O2xJ/DvHQ=?= <burhan.sogutt at gmail.com>,
Burhan =?utf-8?b?U8O2xJ/DvHQ=?= <burhan.sogutt at gmail.com>,
Burhan =?utf-8?b?U8O2xJ/DvHQ=?= <burhan.sogutt at gmail.com>,
Burhan =?utf-8?b?U8O2xJ/DvHQ=?= <burhan.sogutt at gmail.com>,
Burhan =?utf-8?b?U8O2xJ/DvHQ=?= <burhan.sogutt at gmail.com>,
Burhan =?utf-8?b?U8O2xJ/DvHQ=?= <burhan.sogutt at gmail.com>,
Burhan =?utf-8?b?U8O2xJ/DvHQ=?= <burhan.sogutt at gmail.com>,
Burhan =?utf-8?b?U8O2xJ/DvHQ=?= <burhan.sogutt at gmail.com>,
Burhan =?utf-8?b?U8O2xJ/DvHQ=?= <burhan.sogutt at gmail.com>,
Burhan =?utf-8?b?U8O2xJ/DvHQ=?= <burhan.sogutt at gmail.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/157333 at github.com>
================
@@ -0,0 +1,55 @@
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fclangir -Wno-unused-value -emit-cir %s -o %t.cir
+// RUN: FileCheck --input-file=%t.cir %s
+
+unsigned id0() {
+ unsigned a = 1;
+ return ++a;
+}
+
+// CHECK: cir.func dso_local @_Z3id0v() -> !u32i
+// CHECK: %[[#RET:]] = cir.alloca !u32i, !cir.ptr<!u32i>, ["__retval"]
----------------
andykaylor wrote:
I don't like the `#` matches because they prevent the pattern names from being re-used in other ways later in the test. I also strongly prefer `%[[RET:.*]]` over `[[RET:%.*]]` for several reasons: (1) it's easier to see at a glance that the leading `%` marks this as a value, (2) it's easy to miss the fact that the `%` is part of the pattern being matched because at a glance `:%.*` just looks like a bunch of non-alphanumeric symbols and my brain tends to mash them all together as some arbitrary regular expression, and (3) when you have checks that involve labels, the `%` isn't always part of what you're matching, so you can end up with a mix of some patterns that include the `%` and some that don't, which further hurts readability.
https://github.com/llvm/llvm-project/pull/157333
More information about the cfe-commits
mailing list