summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsewardj <unknown>2000-08-22 14:16:06 +0000
committersewardj <unknown>2000-08-22 14:16:06 +0000
commit2a56b41f83f9ffcdc82599f63250eb3b5e5ba9c6 (patch)
treed0b0b20e554163342c8b0c898483eb2dfe1b429a
parent1432af7a72e607d7247cbab358e3569fba3e744e (diff)
downloadhaskell-2a56b41f83f9ffcdc82599f63250eb3b5e5ba9c6.tar.gz
[project @ 2000-08-22 14:16:06 by sewardj]
Add regression check for recent NCG switch table reg-alloc bug fix.
-rw-r--r--ghc/tests/codeGen/should_run/cg048.hs24
-rw-r--r--ghc/tests/codeGen/should_run/cg048.stdout1
2 files changed, 25 insertions, 0 deletions
diff --git a/ghc/tests/codeGen/should_run/cg048.hs b/ghc/tests/codeGen/should_run/cg048.hs
new file mode 100644
index 0000000000..30f0b3e387
--- /dev/null
+++ b/ghc/tests/codeGen/should_run/cg048.hs
@@ -0,0 +1,24 @@
+
+-- The new register allocator in 4.08 had a bug wherein
+-- flow edges away from an insn which does a jump through
+-- a switch table were not being added to the flow graph,
+-- which causes computation of live ranges and thus register
+-- assignment to be wrong in the alternatives and default.
+-- This was fixed properly in the head branch (pre 4.09)
+-- and avoided in 4.08.1 by disabling jump table generation
+-- in the NCG -- it generates trees of ifs instead.
+
+module Main ( main ) where
+
+main = print (map f [1 .. 7])
+
+
+
+{-# NOINLINE f #-}
+f :: Int -> Bool
+f 7 = False
+f 1 = False
+f 4 = False
+f 6 = False
+f 5 = False
+f x = if x * 10 == 20 then True else False
diff --git a/ghc/tests/codeGen/should_run/cg048.stdout b/ghc/tests/codeGen/should_run/cg048.stdout
new file mode 100644
index 0000000000..ff596497db
--- /dev/null
+++ b/ghc/tests/codeGen/should_run/cg048.stdout
@@ -0,0 +1 @@
+[False,True,False,False,False,False,False]