[commit: ghc] master: Test Trac #8832 (ea6dcef)
git at git.haskell.org
git at git.haskell.org
Thu Mar 13 12:25:23 UTC 2014
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/ea6dcef1d9800953b1791304d52884359f415ad9/ghc
>---------------------------------------------------------------
commit ea6dcef1d9800953b1791304d52884359f415ad9
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date: Thu Mar 13 12:24:49 2014 +0000
Test Trac #8832
The test is a bit crude; -ddump-simpl | grep '#'.
I'm concerned that the -ddump-simpl output may differ on 32 and 64-bit
platforms. So far I've only put in output for 64-bit platforms.
>---------------------------------------------------------------
ea6dcef1d9800953b1791304d52884359f415ad9
testsuite/tests/simplCore/should_compile/Makefile | 4 +++
testsuite/tests/simplCore/should_compile/T8832.hs | 28 ++++++++++++++++++++
.../tests/simplCore/should_compile/T8832.stdout | 10 +++++++
testsuite/tests/simplCore/should_compile/all.T | 5 +++-
4 files changed, 46 insertions(+), 1 deletion(-)
diff --git a/testsuite/tests/simplCore/should_compile/Makefile b/testsuite/tests/simplCore/should_compile/Makefile
index 60ad4c7..ca0d552 100644
--- a/testsuite/tests/simplCore/should_compile/Makefile
+++ b/testsuite/tests/simplCore/should_compile/Makefile
@@ -2,6 +2,10 @@ TOP=../../..
include $(TOP)/mk/boilerplate.mk
include $(TOP)/mk/test.mk
+T8832:
+ $(RM) -f T8832.o T8832.hi
+ '$(TEST_HC)' $(TEST_HC_OPTS) -O -c -ddump-simpl T8832.hs | grep '#'
+
T7865:
$(RM) -f T7865.o T7865.hi
'$(TEST_HC)' $(TEST_HC_OPTS) -dsuppress-uniques -O2 -c -ddump-simpl T7865.hs | grep expensive
diff --git a/testsuite/tests/simplCore/should_compile/T8832.hs b/testsuite/tests/simplCore/should_compile/T8832.hs
new file mode 100644
index 0000000..9059a18
--- /dev/null
+++ b/testsuite/tests/simplCore/should_compile/T8832.hs
@@ -0,0 +1,28 @@
+{-# LANGUAGE CPP #-}
+
+-- I'm concerned that the -ddump-simpl output may differ on 32 and 64-bit
+-- platforms. So far I've only put in output for 64-bit platforms.
+
+module T8832 where
+
+import Data.Bits
+import Data.Int
+import Data.Word
+
+#define T(s,T) \
+s :: T ; \
+s = clearBit (bit 0) 0 ; \
+
+T(i,Int)
+T(i8,Int8)
+T(i16,Int16)
+T(i32,Int32)
+T(i64,Int64)
+
+T(w,Word)
+T(w8,Word8)
+T(w16,Word16)
+T(w32,Word32)
+T(w64,Word64)
+
+T(z,Integer)
\ No newline at end of file
diff --git a/testsuite/tests/simplCore/should_compile/T8832.stdout b/testsuite/tests/simplCore/should_compile/T8832.stdout
new file mode 100644
index 0000000..2719631
--- /dev/null
+++ b/testsuite/tests/simplCore/should_compile/T8832.stdout
@@ -0,0 +1,10 @@
+T8832.i = GHC.Types.I# 0
+T8832.i8 = GHC.Int.I8# 0
+T8832.i16 = GHC.Int.I16# 0
+T8832.i32 = GHC.Int.I32# 0
+T8832.i64 = GHC.Int.I64# 0
+T8832.w = GHC.Types.W# (__word 0)
+T8832.w8 = GHC.Word.W8# (__word 0)
+T8832.w16 = GHC.Word.W16# (__word 0)
+T8832.w32 = GHC.Word.W32# (__word 0)
+T8832.w64 = GHC.Word.W64# (__word 0)
diff --git a/testsuite/tests/simplCore/should_compile/all.T b/testsuite/tests/simplCore/should_compile/all.T
index 2f2b337..9e77926 100644
--- a/testsuite/tests/simplCore/should_compile/all.T
+++ b/testsuite/tests/simplCore/should_compile/all.T
@@ -198,4 +198,7 @@ test('T5996',
run_command,
['$MAKE -s --no-print-directory T5996'])
test('T8537', normal, compile, [''])
-test('T8714', normal, compile, [''])
+test('T8832',
+ extra_clean(['T8832.hi', 'T8832a.o']),
+ run_command,
+ ['$MAKE -s --no-print-directory T8832'])
More information about the ghc-commits
mailing list