summaryrefslogtreecommitdiff
path: root/testsuite/tests/primops/should_compile
diff options
context:
space:
mode:
authorJan Stolarek <jan.stolarek@p.lodz.pl>2013-08-14 16:15:43 +0100
committerJan Stolarek <jan.stolarek@p.lodz.pl>2013-08-14 16:15:43 +0100
commit0c03faed43cd010bcbe20f01a95182a93e4f35df (patch)
tree81aac9276563a7f66145e0a9e58bb831802bcb48 /testsuite/tests/primops/should_compile
parent5f18e9e092a65a71a35a78e07b02e4c8ed245f96 (diff)
downloadhaskell-0c03faed43cd010bcbe20f01a95182a93e4f35df.tar.gz
Comparison primops return Int# (Fixes #6135)
This patch adds tests for new primops and fixes the existing ones. For a deatiled discussion of this changes please visit the wiki page: http://hackage.haskell.org/trac/ghc/wiki/PrimBool
Diffstat (limited to 'testsuite/tests/primops/should_compile')
-rw-r--r--testsuite/tests/primops/should_compile/T6135_should_compile.hs22
-rw-r--r--testsuite/tests/primops/should_compile/all.T1
2 files changed, 23 insertions, 0 deletions
diff --git a/testsuite/tests/primops/should_compile/T6135_should_compile.hs b/testsuite/tests/primops/should_compile/T6135_should_compile.hs
new file mode 100644
index 0000000000..b27c6cd8d3
--- /dev/null
+++ b/testsuite/tests/primops/should_compile/T6135_should_compile.hs
@@ -0,0 +1,22 @@
+-- Tests created by Jan Stolarek <jan.stolarek@p.lodz.pl>
+
+{-# LANGUAGE MagicHash #-}
+module Main where
+
+import GHC.Exts
+
+main :: IO ()
+main = do
+ print (h 3.0##)
+ print g
+ print 3.14159
+
+h :: Double# -> String
+h n = if (n ==## 3.0##) || (n ==## 4.0##)
+ then "First branch"
+ else "Second branch"
+
+g :: String
+g = if ((fromInteger 1 :: Integer) == 1)
+ then "First branch"
+ else "Second branch"
diff --git a/testsuite/tests/primops/should_compile/all.T b/testsuite/tests/primops/should_compile/all.T
new file mode 100644
index 0000000000..77f560ae8a
--- /dev/null
+++ b/testsuite/tests/primops/should_compile/all.T
@@ -0,0 +1 @@
+test('T6135_should_compile', only_compiler_types(['ghc']), compile, [''])