Skip to content

Commit 5992124

Browse files
committed
Skip aq/rl instructions
Signed-off-by: Afonso Oliveira <[email protected]>
1 parent d61fb3b commit 5992124

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

ext/auto-inst/test_parsing.py

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ def load_test_data():
3232

3333
return _yaml_instructions, _json_data, _repo_dir
3434

35+
def has_aqrl_variables(yaml_vars):
36+
"""Check if instruction has aq/rl variables."""
37+
if not yaml_vars:
38+
return False
39+
return any(var.get("name") in ["aq", "rl"] for var in yaml_vars)
40+
3541
def pytest_generate_tests(metafunc):
3642
"""Generate test cases dynamically."""
3743
if "instr_name" in metafunc.fixturenames:
@@ -50,12 +56,16 @@ def _find_matching_instruction(self, yaml_instr_name):
5056
for key, value in self.json_data.items():
5157
if not isinstance(value, dict):
5258
continue
59+
60+
# Skip if instruction is pseudo and keep looking
61+
is_pseudo = value.get('isPseudo', '')
62+
if is_pseudo == 1:
63+
continue
64+
5365
asm_string = value.get('AsmString', '').lower().strip()
5466
if not asm_string:
5567
continue
56-
is_pseudo = value.get('isPseudo', "")
57-
if is_pseudo == 1:
58-
continue
68+
5969
base_asm_name = asm_string.split()[0]
6070
if base_asm_name == yaml_instr_name:
6171
return key
@@ -80,6 +90,10 @@ def test_instruction_encoding(self, instr_name):
8090
"""Test encoding for a single instruction."""
8191
yaml_data = self.yaml_instructions[instr_name]
8292

93+
# Skip if the instruction has aq/rl variables
94+
if has_aqrl_variables(yaml_data.get("yaml_vars", [])):
95+
pytest.skip(f"Skipping instruction {instr_name} due to aq/rl variables")
96+
8397
# Skip if no YAML match pattern
8498
if not yaml_data.get("yaml_match"):
8599
pytest.skip(f"Instruction {instr_name} has no YAML match pattern")

0 commit comments

Comments
 (0)