[llvm] [TableGen] Gracefully error out in ParseTreePattern when DAG has zero operands so that llvm-tblgen doesn't crash (PR #161417)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 30 09:29:13 PST 2025


================
@@ -0,0 +1,50 @@
+// The test incorrect classifies the pattern as a typecast and it ends up with
+// typecast DAG with zero arguements, leading to llvm-tblgen crash.
+// This test will check if the error is gracefully handled without any crash.
+ 
+// RUN: not llvm-tblgen -gen-dag-isel -I %p/../../include %s 2>&1 | FileCheck -check-prefix=ERROR-CHK %s
----------------
arsenm wrote:

Might as well use the default check prefix 

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


More information about the llvm-commits mailing list