gh-109287: fix overrides in cases generator (#110419)

This commit is contained in:
Carl Meyer 2023-10-05 15:05:29 -07:00 committed by GitHub
parent bb057b3370
commit 3c0f65ebce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 37 additions and 31 deletions

View file

@ -598,6 +598,41 @@ class TestGeneratedCases(unittest.TestCase):
"""
self.run_cases_test(input, output)
def test_override_inst(self):
input = """
inst(OP, (--)) {
spam();
}
override inst(OP, (--)) {
ham();
}
"""
output = """
TARGET(OP) {
ham();
DISPATCH();
}
"""
self.run_cases_test(input, output)
def test_override_op(self):
input = """
op(OP, (--)) {
spam();
}
macro(M) = OP;
override op(OP, (--)) {
ham();
}
"""
output = """
TARGET(M) {
ham();
DISPATCH();
}
"""
self.run_cases_test(input, output)
if __name__ == "__main__":
unittest.main()