[commit: testsuite] master: add a StableName test (d597962)
Simon Marlow
marlowsd at gmail.com
Thu Feb 14 14:36:06 CET 2013
Repository : ssh://darcs.haskell.org//srv/darcs/testsuite
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/d59796281bc692b0faf614620de1cf3a9f344af4
>---------------------------------------------------------------
commit d59796281bc692b0faf614620de1cf3a9f344af4
Author: Simon Marlow <marlowsd at gmail.com>
Date: Thu Feb 14 13:15:30 2013 +0000
add a StableName test
>---------------------------------------------------------------
tests/rts/all.T | 4 ++++
tests/rts/stablename001.hs | 13 +++++++++++++
.../cgrun033.stdout => rts/stablename001.stdout} | 0
3 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/tests/rts/all.T b/tests/rts/all.T
index 3ccd142..d96e547 100644
--- a/tests/rts/all.T
+++ b/tests/rts/all.T
@@ -164,3 +164,7 @@ test('T7227', [ extra_run_opts('+RTS -tT7227.stat --machine-readable -RTS'),
, compile_and_run, [''] )
test('T7636', [ exit_code(1), extra_run_opts('100000') ], compile_and_run, [''] )
+
+test('stablename001', expect_fail_for(['hpc']), compile_and_run, [''])
+# hpc should fail this, because it tags every variable occurrence with
+# a different tick. It's probably a bug if it works, hence expect_fail.
diff --git a/tests/rts/stablename001.hs b/tests/rts/stablename001.hs
new file mode 100644
index 0000000..f046f7c
--- /dev/null
+++ b/tests/rts/stablename001.hs
@@ -0,0 +1,13 @@
+import System.Mem.StableName
+import System.Mem
+
+-- Test that we get the same StableName even after a GC. This is easy
+-- to get wrong, by not following indirections properly.
+
+main = do
+ let x = [1..10]
+ seq x (return ())
+ n1 <- makeStableName x
+ performGC
+ n2 <- makeStableName x
+ print (n1 == n2)
diff --git a/tests/codeGen/should_run/cgrun033.stdout b/tests/rts/stablename001.stdout
similarity index 100%
copy from tests/codeGen/should_run/cgrun033.stdout
copy to tests/rts/stablename001.stdout
More information about the ghc-commits
mailing list