summaryrefslogtreecommitdiff
path: root/libraries/base/tests/dynamic003.hs
diff options
context:
space:
mode:
authorPaolo Capriotti <p.capriotti@gmail.com>2012-03-09 11:42:24 +0000
committerPaolo Capriotti <p.capriotti@gmail.com>2012-03-09 13:04:46 +0000
commit7e84795cdd797cc3718dfce730e8a7c6a2a31b63 (patch)
tree4035924f4671336aa57028a42b4e3abca7673235 /libraries/base/tests/dynamic003.hs
parentba85754a049791ee795ba887e698523f1885d3f3 (diff)
downloadhaskell-7e84795cdd797cc3718dfce730e8a7c6a2a31b63.tar.gz
Copy tests from GHC testsuite; part of #1161.
Diffstat (limited to 'libraries/base/tests/dynamic003.hs')
-rw-r--r--libraries/base/tests/dynamic003.hs12
1 files changed, 12 insertions, 0 deletions
diff --git a/libraries/base/tests/dynamic003.hs b/libraries/base/tests/dynamic003.hs
new file mode 100644
index 0000000000..fae8bdb276
--- /dev/null
+++ b/libraries/base/tests/dynamic003.hs
@@ -0,0 +1,12 @@
+module Main where
+
+-- Test generation of large TypeReps
+-- (can be used as a benchmark)
+
+import Data.Typeable
+
+f :: Typeable a => Int -> a -> TypeRep
+f 0 a = typeOf a
+f n a = f (n-1) [a]
+
+main = print (f 50000 () == f 50001 ())