Adds test
authorMoritz Angermann <moritz.angermann@gmail.com>
Thu, 21 Sep 2017 14:07:44 +0000 (22:07 +0800)
committerMoritz Angermann <moritz.angermann@gmail.com>
Mon, 5 Feb 2018 01:51:36 +0000 (09:51 +0800)
testsuite/tests/codeGen/should_run/T14251.hs [new file with mode: 0644]
testsuite/tests/codeGen/should_run/T14251.stdout [new file with mode: 0644]
testsuite/tests/codeGen/should_run/all.T

diff --git a/testsuite/tests/codeGen/should_run/T14251.hs b/testsuite/tests/codeGen/should_run/T14251.hs
new file mode 100644 (file)
index 0000000..6f552e1
--- /dev/null
@@ -0,0 +1,22 @@
+{-# LANGUAGE MagicHash, BangPatterns #-}
+module Main where
+
+-- A minor modification from T8064.hs.
+--
+-- The key here is that we ensure that
+-- subsequently passed floats do not
+-- accidentally end up in previous
+-- registers.
+--
+
+import GHC.Exts
+
+{-# NOINLINE f #-}
+f :: (Int# -> Float# -> Double# -> Float# -> Double# -> String) -> String
+f g = g 3# 4.0# 5.0## 6.0# 6.9## ++ " World!"
+
+{-# NOINLINE q #-}
+q :: Int# -> Float# -> Double# -> Float# -> Double# -> String
+q i j k l m = "Hello " ++ show (F# l) ++ " " ++ show (D# m)
+
+main = putStrLn (f $ q)
diff --git a/testsuite/tests/codeGen/should_run/T14251.stdout b/testsuite/tests/codeGen/should_run/T14251.stdout
new file mode 100644 (file)
index 0000000..8ec577b
--- /dev/null
@@ -0,0 +1 @@
+Hello 6.0 6.9 World!
index 9403c4b..1711260 100644 (file)
@@ -166,4 +166,4 @@ test('T13825-unit',
      compile_and_run,
      ['-package ghc'])
 test('T14619', normal, compile_and_run, [''])
-test('T14754', normal, compile_and_run, [''])
+test('T14754', normal, compile_and_run, ['-O2'])