Test Trac #5366
authorSimon Peyton Jones <simonpj@microsoft.com>
Tue, 8 Jan 2013 23:19:43 +0000 (23:19 +0000)
committerSimon Peyton Jones <simonpj@microsoft.com>
Tue, 8 Jan 2013 23:19:43 +0000 (23:19 +0000)
testsuite/tests/simplCore/should_compile/Makefile
testsuite/tests/simplCore/should_compile/T5366.hs [new file with mode: 0644]
testsuite/tests/simplCore/should_compile/T5366.stdout [new file with mode: 0644]
testsuite/tests/simplCore/should_compile/all.T

index 1c2372d..a4fa8ad 100644 (file)
@@ -88,3 +88,6 @@ T7165:
        '$(TEST_HC)' $(TEST_HC_OPTS) -c -O2 T7165a.hs -dcore-lint
        '$(TEST_HC)' $(TEST_HC_OPTS) -c -O2 T7165.hs -dcore-lint
 
+T5366:
+       $(RM) -f T5366.hi T5366.o
+       '$(TEST_HC)' $(TEST_HC_OPTS) -ddump-simpl -dsuppress-uniques -c -O T5366.hs | grep 'Bar.*I#'
diff --git a/testsuite/tests/simplCore/should_compile/T5366.hs b/testsuite/tests/simplCore/should_compile/T5366.hs
new file mode 100644 (file)
index 0000000..ce3b452
--- /dev/null
@@ -0,0 +1,8 @@
+module T5366 where\r
+\r
+newtype Id a = Id Int\r
+data Foo = Foo {-# UNPACK #-} !(Id Foo) String \r
+data Bar = Bar {-# UNPACK #-} !Foo\r
+\r
+f :: Bar -> Int\r
+f (Bar (Foo (Id x) _)) = x\r
diff --git a/testsuite/tests/simplCore/should_compile/T5366.stdout b/testsuite/tests/simplCore/should_compile/T5366.stdout
new file mode 100644 (file)
index 0000000..b0c2249
--- /dev/null
@@ -0,0 +1,2 @@
+                 case ds of _ { T5366.Bar dt [Occ=Once] _ -> GHC.Types.I# dt }}]\r
+    case ds of _ { T5366.Bar dt dt1 -> GHC.Types.I# dt }\r
index b25e25b..5787149 100644 (file)
@@ -156,3 +156,7 @@ test('T7165',
      ['$MAKE -s --no-print-directory T7165'])
 test('T7287', normal, compile, [''])
 test('T7360', only_ways(['optasm']), compile, ['-ddump-simpl -dsuppress-uniques'])
+test('T5366',
+     normal,
+     run_command,
+     ['$MAKE -s --no-print-directory T5366'])