summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Scott <ryan.gl.scott@gmail.com>2017-01-04 13:57:25 -0500
committerRyan Scott <ryan.gl.scott@gmail.com>2017-01-04 13:57:28 -0500
commit8aba3d4a3161ed93de04cd154774cdd016bee6ad (patch)
treed3def787f254fc7a90347016de3ba233b2ea89af
parentdf723689c415573fa6c7d83663758154fa7dc46f (diff)
downloadhaskell-wip/T13056.tar.gz
Add performance test for #13056wip/T13056
This performance regression was fixed by commit 517d03e41b4f5c144d1ad684539340421be2be2a (#12234). Let's add a performance test to ensure that it doesn't break again.
-rw-r--r--testsuite/tests/perf/compiler/T13056.hs26
-rw-r--r--testsuite/tests/perf/compiler/all.T10
2 files changed, 36 insertions, 0 deletions
diff --git a/testsuite/tests/perf/compiler/T13056.hs b/testsuite/tests/perf/compiler/T13056.hs
new file mode 100644
index 0000000000..046e1b0747
--- /dev/null
+++ b/testsuite/tests/perf/compiler/T13056.hs
@@ -0,0 +1,26 @@
+{-# LANGUAGE DeriveDataTypeable #-}
+{-# LANGUAGE DeriveGeneric #-}
+{-# LANGUAGE DeriveFunctor #-}
+{-# LANGUAGE DeriveFoldable #-}
+
+module Bug where
+import Data.Typeable
+import GHC.Generics
+import Data.Data
+
+data Condition v = Condition
+ deriving (Functor, Foldable)
+
+data CondTree v c a = CondNode
+ { condTreeData :: a
+ , condTreeConstraints :: c
+ , condTreeComponents :: [CondBranch v c a]
+ }
+ deriving (Functor, Foldable)
+
+data CondBranch v c a = CondBranch
+ { condBranchCondition :: Condition v
+ , condBranchIfTrue :: CondTree v c a
+ , condBranchIfFalse :: Maybe (CondTree v c a)
+ }
+ deriving (Functor, Foldable)
diff --git a/testsuite/tests/perf/compiler/all.T b/testsuite/tests/perf/compiler/all.T
index 2714e865c0..5d61ae397b 100644
--- a/testsuite/tests/perf/compiler/all.T
+++ b/testsuite/tests/perf/compiler/all.T
@@ -898,3 +898,13 @@ test('T12234',
],
compile,
[''])
+
+test('T13056',
+ [ only_ways(['optasm']),
+ compiler_stats_num_field('bytes allocated',
+ [(wordsize(64), 1, 5),
+ # 2017-01-04 1 initial
+ ]),
+ ],
+ compile,
+ ['-O1'])