Test Trac #6048
authorSimon Peyton Jones <simonpj@microsoft.com>
Wed, 9 May 2012 16:59:14 +0000 (17:59 +0100)
committerSimon Peyton Jones <simonpj@microsoft.com>
Wed, 9 May 2012 17:01:22 +0000 (18:01 +0100)
testsuite/tests/perf/compiler/T6048.hs [new file with mode: 0644]
testsuite/tests/perf/compiler/all.T

diff --git a/testsuite/tests/perf/compiler/T6048.hs b/testsuite/tests/perf/compiler/T6048.hs
new file mode 100644 (file)
index 0000000..e4c1ed4
--- /dev/null
@@ -0,0 +1,42 @@
+module T6048 where
+
+import Control.Applicative
+
+data X = X
+  (Maybe String)
+  (Maybe String)
+  (Maybe String)
+  (Maybe String)
+  (Maybe String)
+  (Maybe String)
+  (Maybe String)
+  (Maybe String)
+  (Maybe String)
+
+mb :: (String -> Maybe a) -> String -> Maybe (Maybe a)
+mb _ ""  = Just Nothing
+mb _ "-" = Just Nothing
+mb p xs  = Just <$> p xs
+
+run :: [String] -> Maybe X
+run
+  [ x1
+  , x2
+  , x3
+  , x4
+  , x5
+  , x6
+  , x7
+  , x8
+  , x9
+  ] = X
+  <$> mb pure x1
+  <*> mb pure x2
+  <*> mb pure x3
+  <*> mb pure x4
+  <*> mb pure x5
+  <*> mb pure x6
+  <*> mb pure x7
+  <*> mb pure x8
+  <*> mb pure x9
+
index 139432d..b3f408c 100644 (file)
@@ -251,3 +251,13 @@ test('T5837',
           compiler_stats_range_field('bytes allocated', 79110184, 10))
       ],
       compile_fail,['-fcontext-stack=50'])
+
+test('T6048',
+     [ only_ways(['optasm']),
+      if_wordsize(32, # sample from x86/Linux
+          compiler_stats_range_field('bytes allocated', 38000000, 10)),
+
+      if_wordsize(64,
+          compiler_stats_range_field('bytes allocated', 77000000, 10))
+      ],
+      compile,[''])