mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
GH-125521: Remove if (true)
from generated output to reduce C compiler warnings (GH-125700)
This commit is contained in:
parent
c1bdbe84c8
commit
57e3c59bb6
4 changed files with 75 additions and 40 deletions
|
@ -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 = """
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue