diff options
author | Andreas Klebinger <klebinger.andreas@gmx.at> | 2021-11-22 13:39:46 +0100 |
---|---|---|
committer | Andreas Klebinger <klebinger.andreas@gmx.at> | 2021-11-22 13:40:14 +0100 |
commit | 01806a0185b71ee1d8e5a42314c699d7dbcd35b0 (patch) | |
tree | 02b6c6d32aeade868be452f42f0a8940858aeb7f | |
parent | 6390afb8437011e128b334655b275211de7824ce (diff) | |
download | haskell-wip/andreask/improve_sink.tar.gz |
Don't include types in test outputwip/andreask/improve_sink
-rw-r--r-- | testsuite/driver/testlib.py | 10 | ||||
-rw-r--r-- | testsuite/tests/cmm/should_compile/all.T | 2 | ||||
-rw-r--r-- | testsuite/tests/cmm/should_compile/cmm_sink_sp.cmm | 24 | ||||
-rw-r--r-- | testsuite/tests/cmm/should_compile/cmm_sink_sp.stderr | 41 |
4 files changed, 32 insertions, 45 deletions
diff --git a/testsuite/driver/testlib.py b/testsuite/driver/testlib.py index d4c8fc38f7..667d743e0b 100644 --- a/testsuite/driver/testlib.py +++ b/testsuite/driver/testlib.py @@ -800,20 +800,20 @@ def check_errmsg(needle): return "%s not contained in -ddump-simpl\n" % needle return normalise_errmsg_fun(norm) -# grep_errmsg(regex,[match_only]) -# If match_only = True we only check the part of the error +# grep_errmsg(regex,[groups]) +# If groups are given, return only the matched groups # that matches the regex. -def grep_errmsg(needle:str, match_only = False): +def grep_errmsg(needle:str, groups = None): def get_match(str:str): m = re.search(needle,str) if m: - return m.group(0) + return "".join([m.group(g) for g in groups if m.group(g) is not None]) else: return None def norm(str) -> str: - if not match_only: + if groups == None: return "".join( filter(lambda l: re.search(needle,l), str.splitlines(True))) else: diff --git a/testsuite/tests/cmm/should_compile/all.T b/testsuite/tests/cmm/should_compile/all.T index 735bd1c9fd..9fc5479634 100644 --- a/testsuite/tests/cmm/should_compile/all.T +++ b/testsuite/tests/cmm/should_compile/all.T @@ -1,6 +1,6 @@ # test('selfloop', [cmm_src], compile, ['-no-hs-main']) -test('cmm_sink_sp', [ only_ways(['optasm']), grep_errmsg('I64\[Sp.*\].*=.*\[.*R1.*\].*;',True), cmm_src], compile, ['-no-hs-main -ddump-cmm -dsuppress-uniques -O']) +test('cmm_sink_sp', [ only_ways(['optasm']), grep_errmsg('(\[Sp.*\]).*(=).*(\[.*R1.*\]).*;',[1,2,3]), cmm_src], compile, ['-no-hs-main -ddump-cmm -dsuppress-uniques -O']) test('T16930', normal, makefile_test, ['T16930']) test('T17442', normal, compile, ['']) diff --git a/testsuite/tests/cmm/should_compile/cmm_sink_sp.cmm b/testsuite/tests/cmm/should_compile/cmm_sink_sp.cmm index 1b2d02dd6f..24d51f5298 100644 --- a/testsuite/tests/cmm/should_compile/cmm_sink_sp.cmm +++ b/testsuite/tests/cmm/should_compile/cmm_sink_sp.cmm @@ -3,22 +3,22 @@ stg_sink_things ( P_ x1 ) { W_ res; - W_ x2, x3, x4, x5, x6, x7, x8, x9; + W_ x2, x3, x4, x5, x6; // Should produce a series of loads that are sunk into // stores to Sp like this: // I64[Sp - 64] = I64[R1 + 1]; // CmmStore // I64[Sp - 56] = I64[R1 + 2]; // CmmStore - x2 = W_[x1+1]; - x3 = W_[x1+2]; - x4 = W_[x1+3]; - x5 = W_[x1+4]; - x6 = W_[x1+5]; - x7 = W_[x1+6]; - x8 = W_[x1+7]; - x9 = W_[x1+8]; + x2 = W_[x1+4]; + x3 = W_[x1+8]; + x4 = W_[x1+12]; + x5 = W_[x1+16]; + x6 = W_[x1+20]; + W_[Sp - 8] = x2; + W_[Sp - 16] = x3; + W_[Sp - 24] = x4; + W_[Sp - 32] = x5; + W_[Sp - 40] = x6; - call R1(x1); - res = x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8 + x9; - return (res); + return (x1); }
\ No newline at end of file diff --git a/testsuite/tests/cmm/should_compile/cmm_sink_sp.stderr b/testsuite/tests/cmm/should_compile/cmm_sink_sp.stderr index ca5f89ea5b..ebb668a58a 100644 --- a/testsuite/tests/cmm/should_compile/cmm_sink_sp.stderr +++ b/testsuite/tests/cmm/should_compile/cmm_sink_sp.stderr @@ -1,11 +1,7 @@ ==================== Output Cmm ==================== [stg_sink_things() { // [R1] - { info_tbls: [(cb, - label: block_info - rep: StackRep [False, True, True, True, True, True, True, True, - True] - srt: Nothing)] + { info_tbls: [] stack_info: arg_space: 8 } {offset @@ -13,28 +9,19 @@ //tick src<cmm_sink_sp.cmm:(4,1)-(24,1)> //tick src<cmm_sink_sp.cmm:12:8-22> //tick src<cmm_sink_sp.cmm:13:8-22> - //tick src<cmm_sink_sp.cmm:14:8-22> - //tick src<cmm_sink_sp.cmm:15:8-22> - //tick src<cmm_sink_sp.cmm:16:8-22> - //tick src<cmm_sink_sp.cmm:17:8-22> - //tick src<cmm_sink_sp.cmm:18:8-22> - //tick src<cmm_sink_sp.cmm:19:8-22> - I64[Sp - 80] = cb; // CmmStore - P64[Sp - 72] = R1; // CmmStore - I64[Sp - 64] = I64[R1 + 1]; // CmmStore - I64[Sp - 56] = I64[R1 + 2]; // CmmStore - I64[Sp - 48] = I64[R1 + 3]; // CmmStore - I64[Sp - 40] = I64[R1 + 4]; // CmmStore - I64[Sp - 32] = I64[R1 + 5]; // CmmStore - I64[Sp - 24] = I64[R1 + 6]; // CmmStore - I64[Sp - 16] = I64[R1 + 7]; // CmmStore - I64[Sp - 8] = I64[R1 + 8]; // CmmStore - Sp = Sp - 80; // CmmAssign - call (R1)(R1) returns to cb, args: 8, res: 8, upd: 8; // CmmCall - _lbl_: // global - //tick src<cmm_sink_sp.cmm:22:9-53> - R1 = P64[Sp + 8] + (I64[Sp + 16] + (I64[Sp + 24] + (I64[Sp + 32] + (I64[Sp + 40] + (I64[Sp + 48] + (I64[Sp + 56] + (I64[Sp + 64] + I64[Sp + 72]))))))); // CmmAssign - Sp = Sp + 80; // CmmAssign + //tick src<cmm_sink_sp.cmm:14:8-23> + //tick src<cmm_sink_sp.cmm:15:8-23> + //tick src<cmm_sink_sp.cmm:16:8-23> + //tick src<cmm_sink_sp.cmm:17:11-24> + I64[Sp - 8] = I64[R1 + 4]; // CmmStore + //tick src<cmm_sink_sp.cmm:18:11-25> + I64[Sp - 16] = I64[R1 + 8]; // CmmStore + //tick src<cmm_sink_sp.cmm:19:11-25> + I64[Sp - 24] = I64[R1 + 12]; // CmmStore + //tick src<cmm_sink_sp.cmm:20:11-25> + I64[Sp - 32] = I64[R1 + 16]; // CmmStore + //tick src<cmm_sink_sp.cmm:21:11-25> + I64[Sp - 40] = I64[R1 + 20]; // CmmStore call (P64[Sp])(R1) args: 8, res: 0, upd: 8; // CmmCall } }] |