summaryrefslogtreecommitdiff
path: root/testsuite/tests/codeGen/should_run/cgrun067.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/codeGen/should_run/cgrun067.hs')
-rw-r--r--testsuite/tests/codeGen/should_run/cgrun067.hs11
1 files changed, 11 insertions, 0 deletions
diff --git a/testsuite/tests/codeGen/should_run/cgrun067.hs b/testsuite/tests/codeGen/should_run/cgrun067.hs
new file mode 100644
index 0000000000..74666c1ee6
--- /dev/null
+++ b/testsuite/tests/codeGen/should_run/cgrun067.hs
@@ -0,0 +1,11 @@
+-- This test-case tickled a bug where an optimization pass incorrectly
+-- reloaded a stack slot before the slot was initialized. It was a bit
+-- tricky to reproduce, and I don't really know why this particular
+-- harness was necessary.
+
+-- Miscompiled code must be in another module, otherwise problem doesn't
+-- show up.
+import Cgrun067A (miscompiledFn)
+import Foreign.C.String
+
+main = withCString "foobar" $ \p -> print =<< miscompiledFn p