Test Trac #7507
authorSimon Peyton Jones <simonpj@microsoft.com>
Mon, 24 Dec 2012 15:53:56 +0000 (15:53 +0000)
committerSimon Peyton Jones <simonpj@microsoft.com>
Mon, 24 Dec 2012 15:53:56 +0000 (15:53 +0000)
testsuite/tests/perf/should_run/T7507.hs [new file with mode: 0644]
testsuite/tests/perf/should_run/T7507.stdout [new file with mode: 0644]
testsuite/tests/perf/should_run/all.T

diff --git a/testsuite/tests/perf/should_run/T7507.hs b/testsuite/tests/perf/should_run/T7507.hs
new file mode 100644 (file)
index 0000000..04f156d
--- /dev/null
@@ -0,0 +1,14 @@
+module Main where
+
+import Data.Int
+import System.Environment
+
+bitcount x = if x > 0 
+    then let (d,m) = divMod x 2 in  bitcount d + m
+    else 0
+
+main = print $ sum  $ map bitcount 
+       [ 0 :: Int64 .. 2^20 - 1 ]
+
+
+
diff --git a/testsuite/tests/perf/should_run/T7507.stdout b/testsuite/tests/perf/should_run/T7507.stdout
new file mode 100644 (file)
index 0000000..a6ec9d9
--- /dev/null
@@ -0,0 +1 @@
+10485760
index 2fa0582..9e42201 100644 (file)
@@ -266,3 +266,6 @@ test('Conversions',
       only_ways(['normal'])
      ],
     compile_and_run, ['-O'])
+
+test('T7507', normal, compile_and_run, ['-O'])
+# For 7507, stack overflow is the bad case