GH-125521: Remove if (true) from generated output to reduce C compiler warnings (GH-125700)

This commit is contained in:
Mark Shannon 2024-10-22 10:11:29 +01:00 committed by GitHub
parent c1bdbe84c8
commit 57e3c59bb6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 75 additions and 40 deletions

View file

@ -1270,6 +1270,33 @@ class TestGeneratedCases(unittest.TestCase):
"""
self.run_cases_test(input, output)
def test_error_if_true(self):
input = """
inst(OP1, ( --)) {
ERROR_IF(true, here);
}
inst(OP2, ( --)) {
ERROR_IF(1, there);
}
"""
output = """
TARGET(OP1) {
frame->instr_ptr = next_instr;
next_instr += 1;
INSTRUCTION_STATS(OP1);
goto here;
}
TARGET(OP2) {
frame->instr_ptr = next_instr;
next_instr += 1;
INSTRUCTION_STATS(OP2);
goto there;
}
"""
self.run_cases_test(input, output)
def test_scalar_array_inconsistency(self):
input = """