llvm-project/llvm/test/TableGen/ConstraintChecking3.td
Jason Eckhardt f676e84bba
[TableGen] Fix operand constraint checking problem. (#85859)
Currently operand constraint checks on "$dest = $src" are inadvertently
accepting any token that contains "=". This has surprising results, e.g,
"$dest != $src" is accepted as a constraint but then treated as "=".

This patch ensures that only exactly the token "=" is accepted.
2024-03-20 13:32:38 -05:00

9 lines
356 B
TableGen

// RUN: not llvm-tblgen -gen-asm-writer -I %p -I %p/../../include %s 2>&1 | FileCheck %s -DFILE=%s
include "ConstraintChecking.inc"
// (This is illegal because the '=' has to be surrounded by whitespace)
// CHECK: [[FILE]]:[[@LINE+1]]:5: error: Unrecognized constraint '$dest1=$dest2' in 'Foo'
def Foo : TestInstructionWithConstraints<"$dest1=$dest2">;