summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2024-10-22 09:11:29 (GMT)
committerGitHub <noreply@github.com>2024-10-22 09:11:29 (GMT)
commit57e3c59bb64fc2f8b2845a7e03ab0abb029ccd02 (patch)
tree8069ffb48c0310031aa128a8870714bf1958fed6 /Lib/test
parentc1bdbe84c8ab29b68bb109328e02af9464f104b3 (diff)
downloadcpython-57e3c59bb64fc2f8b2845a7e03ab0abb029ccd02.zip
cpython-57e3c59bb64fc2f8b2845a7e03ab0abb029ccd02.tar.gz
cpython-57e3c59bb64fc2f8b2845a7e03ab0abb029ccd02.tar.bz2
GH-125521: Remove `if (true)` from generated output to reduce C compiler warnings (GH-125700)
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_generated_cases.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/Lib/test/test_generated_cases.py b/Lib/test/test_generated_cases.py
index cd3718b..95813e1 100644
--- a/Lib/test/test_generated_cases.py
+++ b/Lib/test/test_generated_cases.py
@@ -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 = """