diff options
Diffstat (limited to 'testsuite/tests')
-rw-r--r-- | testsuite/tests/perf/compiler/T18923.hs | 16 | ||||
-rw-r--r-- | testsuite/tests/perf/compiler/all.T | 4 |
2 files changed, 20 insertions, 0 deletions
diff --git a/testsuite/tests/perf/compiler/T18923.hs b/testsuite/tests/perf/compiler/T18923.hs new file mode 100644 index 0000000000..4127469283 --- /dev/null +++ b/testsuite/tests/perf/compiler/T18923.hs @@ -0,0 +1,16 @@ +module T18923 (mergeRec, Rec) where + +mayMerge :: Maybe b -> Maybe b -> Maybe b +mayMerge Nothing y = y +mayMerge x Nothing = x +mayMerge (Just x) (Just y) = Just y + +data Rec = Rec { v0,v1,v2,v3,v4,v5,v6,v7 :: !(Maybe Bool) } + +mergeRec :: Rec -> Rec -> Rec +mergeRec + (Rec a0 a1 a2 a3 a4 a5 a6 a7) + (Rec b0 b1 b2 b3 b4 b5 b6 b7) = + Rec (mayMerge a0 b0) (mayMerge a1 b1) (mayMerge a2 b2) (mayMerge a3 b3) + (mayMerge a4 b4) (mayMerge a5 b5) (mayMerge a6 b6) (mayMerge a7 b7) + diff --git a/testsuite/tests/perf/compiler/all.T b/testsuite/tests/perf/compiler/all.T index 46222c723a..1eace3ac0a 100644 --- a/testsuite/tests/perf/compiler/all.T +++ b/testsuite/tests/perf/compiler/all.T @@ -434,3 +434,7 @@ test ('T18223', ], compile, ['-v0 -O']) +test ('T18923', + [ collect_compiler_stats('bytes allocated',2) ], + compile, + ['-v0 -O']) |