* When `--enable-var-scope` is active,
`lib/FileCheck.cpp#clearLocalVars` gets called.
* That function loops through `GlobalNumericVariableTable` and then
calls `NumericVariable::clear` on most items. It also removes them from
`GlobalNumericVariableTable`.
* When reassigning an already cleared variable, `Pattern::match` calls
`NumericVariable::setValue`, but it doesn't reinsert it into
`GlobalNumericVariableTable`. Therefore, the next time `clearLocalVars`
is called, it won't be able to loop through the variables.
Fix it by reinserting them in `GlobalNumericVariableTable` inside
`Pattern::match`.
Co-authored-by: Thomas Preud'homme <thomas.preudhomme@arm.com>