[clang] [CIR] Add support for the IdiomRecognizer pass (PR #208854)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 13 07:19:19 PDT 2026


================
@@ -0,0 +1,57 @@
+// RUN: %clang_cc1 -std=c++17 -triple x86_64-unknown-linux-gnu -fclangir -clangir-enable-idiom-recognizer -emit-cir -mmlir --mlir-print-ir-after=cir-idiom-recognizer %s -o /dev/null 2>&1 | FileCheck %s --implicit-check-not=cir.std.
+// RUN: %clang_cc1 -std=c++17 -triple x86_64-unknown-linux-gnu -DVOID_RESULT -fclangir -clangir-enable-idiom-recognizer -emit-cir -mmlir --mlir-print-ir-after=cir-idiom-recognizer %s -o /dev/null 2>&1 | FileCheck %s --check-prefix=VOID --implicit-check-not=cir.std.
+
+// Each call satisfies every recognizer check except the one guard it pins,
+// and stays the call to the overload its comment names.
+
+#ifdef VOID_RESULT
----------------
erichkeane wrote:

Can we just split this into 2 tests?  Don't use macros unnecessarily in tests.

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


More information about the cfe-commits mailing list