aco/tests: fix skip_lines=True with remaining characters in matches

If the remaining character check fails, we should try a later line if
skip_lines=True. So the check has to be done earlier.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32902>
This commit is contained in:
Rhys Perry
2024-12-20 18:16:33 +00:00
committed by Marge Bot
parent 8a55de3338
commit 8ac4744706
2 changed files with 10 additions and 12 deletions

View File

@@ -221,7 +221,14 @@ def do_match(g, pattern, output, skip_lines, in_func=False):
c = pattern.read(1)
fail = False
if c == '':
break
if not in_func:
while output.peek() in [' ', '\t']:
output.read(1)
if output.read(1) not in ['', '\n']:
res.fail('expected end of output')
if res.success:
break
elif output.peek() == '':
res.fail('unexpected end of output')
elif c == '\\':
@@ -310,14 +317,6 @@ def do_match(g, pattern, output, skip_lines, in_func=False):
escape = False
if not in_func:
while output.peek() in [' ', '\t']:
output.read(1)
if output.read(1) not in ['', '\n']:
res.fail('expected end of output')
return res
return res
class PatternCheck(Check):

View File

@@ -115,9 +115,8 @@ BEGIN_TEST(d3d11_derivs.discard)
pbld.add_vsfs(vs, fs);
/* The discard gets emitted as demote_if. */
//>> s2: %global, s1: (kill)%_:scc = s_andn2_b64 (kill)%_, (kill)%_
//>> s2: %_:exec, s1: (kill)%_:scc = s_wqm_b64 %global
//>> p_exit_early_if_not %_:exec
//>> s2: %_:exec, s1: (kill)%_:scc = s_wqm_b64 %_
//! p_exit_early_if_not %_:exec
//>> v4: %_ = image_sample (kill)%_, (kill)%_, v1: undef, (kill)%_, (kill)%_ 2d
pbld.print_ir(VK_SHADER_STAGE_FRAGMENT_BIT, "ACO IR");
END_TEST