Tablegen seg faulted when parsing a Pat where the destination part has
no output (zero instruction), due to a register class lookup using
Nice that we no longer crash, but I don't know how relevant this check is. What about checking that we get the "warning: Skipped pattern: Dst pattern root isn't a known leaf" message instead?
One solution could be to do -o /dev/null and ... 2>&1 | FileCheck %s, to simply ignore regular output, and FileCheck on both stdout and stderr (in case the warning is printed on stderr).
I'm not sure exactly how tblgen emit those warnings, which stream, or if it is conditional based on how the binary is built (e.g. using -debug in test cases usually also require that you add // REQUIRES: asserts to avoid running the test case when debug support isn't included.
But I think that simply checking for the warning would work here. FileCheck is just doing pattern matching on it's input.