summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2016-04-21 13:29:37 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2016-04-22 11:32:33 +0100
commit251a376baf9b3824a67fba3bfb9a72bc31cf8e33 (patch)
tree066d354adb301d31160920030f0d5a398581d879 /testsuite
parent9421b0c77122d40bf72665ea9f90dca64a0a0ae2 (diff)
downloadhaskell-251a376baf9b3824a67fba3bfb9a72bc31cf8e33.tar.gz
Test Trac #3990
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/tests/simplCore/should_compile/Makefile5
-rw-r--r--testsuite/tests/simplCore/should_compile/T3990.hs12
-rw-r--r--testsuite/tests/simplCore/should_compile/T3990.stdout2
-rw-r--r--testsuite/tests/simplCore/should_compile/all.T4
4 files changed, 23 insertions, 0 deletions
diff --git a/testsuite/tests/simplCore/should_compile/Makefile b/testsuite/tests/simplCore/should_compile/Makefile
index 87b1d95c3d..8b7da66e27 100644
--- a/testsuite/tests/simplCore/should_compile/Makefile
+++ b/testsuite/tests/simplCore/should_compile/Makefile
@@ -2,6 +2,11 @@ TOP=../../..
include $(TOP)/mk/boilerplate.mk
include $(TOP)/mk/test.mk
+T3990:
+ $(RM) -f T3990.o T3990.hi
+ '$(TEST_HC)' $(TEST_HC_OPTS) -O -c -ddump-simpl T3990.hs | grep 'test_case'
+ # Grep output should show an unpacked constructor
+
T8832:
$(RM) -f T8832.o T8832.hi
'$(TEST_HC)' $(TEST_HC_OPTS) $(T8832_WORDSIZE_OPTS) -O -c -ddump-simpl T8832.hs | grep '^[a-zA-Z0-9]\+ ='
diff --git a/testsuite/tests/simplCore/should_compile/T3990.hs b/testsuite/tests/simplCore/should_compile/T3990.hs
new file mode 100644
index 0000000000..9877175c76
--- /dev/null
+++ b/testsuite/tests/simplCore/should_compile/T3990.hs
@@ -0,0 +1,12 @@
+{-# LANGUAGE TypeFamilies #-}
+module T3990 where
+
+data family Complex a
+data instance Complex Double = CD {-# UNPACK #-} !Double
+ {-# UNPACK #-} !Double
+
+data T = T {-# UNPACK #-} !(Complex Double)
+-- This shouuld actually get unpacked!
+
+test_case :: T
+test_case = T (CD 1 1)
diff --git a/testsuite/tests/simplCore/should_compile/T3990.stdout b/testsuite/tests/simplCore/should_compile/T3990.stdout
new file mode 100644
index 0000000000..20d0871499
--- /dev/null
+++ b/testsuite/tests/simplCore/should_compile/T3990.stdout
@@ -0,0 +1,2 @@
+test_case :: T
+test_case = T3990.T 1.0## 1.0##
diff --git a/testsuite/tests/simplCore/should_compile/all.T b/testsuite/tests/simplCore/should_compile/all.T
index 9f3af8b192..7aba48508f 100644
--- a/testsuite/tests/simplCore/should_compile/all.T
+++ b/testsuite/tests/simplCore/should_compile/all.T
@@ -232,3 +232,7 @@ test('T11232', normal, compile, ['-O2'])
test('T11562', normal, compile, ['-O2'])
test('T11742', normal, compile, ['-O2'])
test('T11644', normal, compile, ['-O2'])
+test('T3990',
+ normal,
+ run_command,
+ ['$MAKE -s --no-print-directory T3990'])