[commit: ghc] master: Testcase for #13719 (17fef39)

git at git.haskell.org git at git.haskell.org
Mon May 22 16:41:52 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/17fef390c575c153c7e70438783e7f8fee62e451/ghc

>---------------------------------------------------------------

commit 17fef390c575c153c7e70438783e7f8fee62e451
Author: Bartosz Nitka <niteria at gmail.com>
Date:   Mon May 22 12:00:52 2017 -0400

    Testcase for #13719
    
    I expect to improve this, a testcase will ensure
    it doesn't regress.
    
    Test Plan: ./validate
    
    Reviewers: simonmar, austin, bgamari
    
    Reviewed By: bgamari
    
    Subscribers: rwbarton, thomie
    
    GHC Trac Issues: #13719
    
    Differential Revision: https://phabricator.haskell.org/D3600


>---------------------------------------------------------------

17fef390c575c153c7e70438783e7f8fee62e451
 testsuite/tests/perf/compiler/all.T     | 11 +++++++++++
 testsuite/tests/perf/compiler/genT13719 | 31 +++++++++++++++++++++++++++++++
 2 files changed, 42 insertions(+)

diff --git a/testsuite/tests/perf/compiler/all.T b/testsuite/tests/perf/compiler/all.T
index c90378b..17da229 100644
--- a/testsuite/tests/perf/compiler/all.T
+++ b/testsuite/tests/perf/compiler/all.T
@@ -1108,3 +1108,14 @@ test('MultiLayerModules',
      ],
      multimod_compile,
      ['MultiLayerModules', '-v0'])
+
+test('T13719',
+     [ compiler_stats_num_field('bytes allocated',
+          [(wordsize(64), 49907410784, 10),
+          # initial:    49907410784
+          ]),
+       pre_cmd('./genT13719'),
+       extra_files(['genT13719']),
+     ],
+     multimod_compile,
+     ['T13719', '-v0'])
diff --git a/testsuite/tests/perf/compiler/genT13719 b/testsuite/tests/perf/compiler/genT13719
new file mode 100755
index 0000000..ccc078e
--- /dev/null
+++ b/testsuite/tests/perf/compiler/genT13719
@@ -0,0 +1,31 @@
+#!/bin/bash
+# Generate $DEPTH layers of modules with $WIDTH modules on each layer
+# Every module on layer N imports all the modules on layer N-1
+# $ROOT.hs imports all the modules from the last layer
+# Every module defines a datatype that derives Generic.
+# The derived Generic defines one 'Rep' type family instance.
+DEPTH=2
+WIDTH=100
+ROOT=T13719
+for i in $(seq -w 1 $WIDTH); do
+  l=0
+  echo "{-# LANGUAGE DeriveGeneric #-}" > DummyLevel${l}M$i.hs;
+  echo "module DummyLevel${l}M$i where" >> DummyLevel${l}M$i.hs;
+  echo "import GHC.Generics" >> DummyLevel${l}M$i.hs;
+  echo "data DummyLevel${l}M${i}G = DummyLevel${l}M${i}G deriving Generic" >> DummyLevel${l}M$i.hs;
+done
+for l in $(seq 1 $DEPTH); do
+  for i in $(seq -w 1 $WIDTH); do
+    echo "{-# LANGUAGE DeriveGeneric #-}" > DummyLevel${l}M$i.hs;
+    echo "module DummyLevel${l}M$i where" >> DummyLevel${l}M$i.hs;
+    echo "import GHC.Generics" >> DummyLevel${l}M$i.hs;
+    for j in $(seq -w 1 $WIDTH); do
+      echo "import DummyLevel$((l-1))M$j" >> DummyLevel${l}M$i.hs;
+    done
+    echo "data DummyLevel${l}M${i}G = DummyLevel${l}M${i}G deriving Generic" >> DummyLevel${l}M$i.hs;
+  done
+done
+echo "module ${ROOT} where" > $ROOT.hs
+for j in $(seq -w 1 $WIDTH); do
+  echo "import DummyLevel${DEPTH}M$j" >> $ROOT.hs;
+done



More information about the ghc-commits mailing list