Repository : ssh://darcs.haskell.org//srv/darcs/testsuite

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/29720df7c11237a87ed20f19928c43df3db4e979

>---------------------------------------------------------------

commit 29720df7c11237a87ed20f19928c43df3db4e979
Author: Ian Lynagh <[email protected]>
Date:   Sun Apr 17 18:14:48 2011 +0100

    Replace simplrun006 with a less fragile perf test T149

>---------------------------------------------------------------

 tests/ghc-regress/perf/should_run/Makefile         |   10 ++++-
 tests/ghc-regress/perf/should_run/T149_A.hs        |   25 +++++++++++
 tests/ghc-regress/perf/should_run/T149_B.hs        |   26 ++++++++++++
 tests/ghc-regress/perf/should_run/all.T            |   22 ++++++----
 tests/ghc-regress/simplCore/should_run/all.T       |    3 -
 .../simplCore/should_run/simplrun006.hs            |   44 --------------------
 .../simplCore/should_run/simplrun006.stdout        |    6 ---
 7 files changed, 74 insertions(+), 62 deletions(-)

diff --git a/tests/ghc-regress/perf/should_run/Makefile 
b/tests/ghc-regress/perf/should_run/Makefile
index f40e014..3e0bdb1 100644
--- a/tests/ghc-regress/perf/should_run/Makefile
+++ b/tests/ghc-regress/perf/should_run/Makefile
@@ -24,5 +24,13 @@ T2902:
        $(RM) -f T2902_A_PairingSum.o  T2902_B_PairingSum.o  T2902_Sum.o
        '$(TEST_HC)' -v0 -O --make T2902_A -rtsopts
        '$(TEST_HC)' -v0 -O --make T2902_B -rtsopts
-       BAA=`./T2902_A +RTS -t --machine-readable 2>&1 | grep '"bytes 
allocated"' | sed -e 's/.*, "//' -e 's/")//'`; BAB=`./T2902_B +RTS -t 
--machine-readable 2>&1 | grep '"bytes allocated"' | sed -e 's/.*, "//' -e 
's/")//'`; [ "$$BAA" = "" ] && echo 'T2902_A: No "bytes allocated"'; [ "$$BAA" 
= "$$BAB" ] || echo 'T2902: Mismatch in "bytes allocated"'
+       BAA=`./T2902_A +RTS -t --machine-readable 2>&1 | grep '"bytes 
allocated"' | sed -e 's/.*, "//' -e 's/")//'`; BAB=`./T2902_B +RTS -t 
--machine-readable 2>&1 | grep '"bytes allocated"' | sed -e 's/.*, "//' -e 
's/")//'`; [ "$$BAA" = "" ] && echo 'T2902_A: No "bytes allocated"'; [ "$$BAA" 
= "$$BAB" ] || echo "T2902: Mismatch in \"bytes allocated\": $$BAA $$BAB"
+
+.PHONY: T149
+T149:
+       $(RM) -f T149_A T149_A.hi T149_A.o
+       $(RM) -f T149_B T149_B.hi T149_B.o
+       '$(TEST_HC)' -v0 -O --make T149_A -rtsopts
+       '$(TEST_HC)' -v0 -O --make T149_B -rtsopts
+       BAA=`./T149_A +RTS -t --machine-readable 2>&1 | grep '"bytes 
allocated"' | sed -e 's/.*, "//' -e 's/")//'`; BAB=`./T149_B +RTS -t 
--machine-readable 2>&1 | grep '"bytes allocated"' | sed -e 's/.*, "//' -e 
's/")//'`; [ "$$BAA" = "" ] && echo 'T149_A: No "bytes allocated"'; [ "$$BAA" = 
"$$BAB" ] || echo "T149: Mismatch in \"bytes allocated\": $$BAA $$BAB"
 
diff --git a/tests/ghc-regress/perf/should_run/T149_A.hs 
b/tests/ghc-regress/perf/should_run/T149_A.hs
new file mode 100644
index 0000000..dd74546
--- /dev/null
+++ b/tests/ghc-regress/perf/should_run/T149_A.hs
@@ -0,0 +1,25 @@
+module Main (main) where
+
+-- See Trac #149
+
+-- Curently (with GHC 7.0) the CSE works, just,
+-- but it's delicate.
+
+
+import System.CPUTime
+
+main :: IO ()
+main = print $ playerMostOccur1 [1..m]
+
+m :: Int
+m = 22
+
+playerMostOccur1 :: [Int] -> Int
+playerMostOccur1 [a] = a
+playerMostOccur1 (x:xs)
+ | numOccur x (x:xs) > numOccur (playerMostOccur1 xs) xs = x
+ | otherwise = playerMostOccur1 xs
+
+numOccur :: Int -> [Int] -> Int
+numOccur i is = length $ filter (i ==) is
+
diff --git a/tests/ghc-regress/perf/should_run/T149_B.hs 
b/tests/ghc-regress/perf/should_run/T149_B.hs
new file mode 100644
index 0000000..fcc87cd
--- /dev/null
+++ b/tests/ghc-regress/perf/should_run/T149_B.hs
@@ -0,0 +1,26 @@
+module Main (main) where
+
+-- See Trac #149
+
+-- Curently (with GHC 7.0) the CSE works, just,
+-- but it's delicate.
+
+
+import System.CPUTime
+
+main :: IO ()
+main = print $ playerMostOccur2 [1..m]
+
+m :: Int
+m = 22
+
+playerMostOccur2 :: [Int] -> Int
+playerMostOccur2 [a] = a
+playerMostOccur2 (x:xs)
+ | numOccur x (x:xs) > numOccur pmo xs = x
+ | otherwise = pmo
+    where pmo = playerMostOccur2 xs
+
+numOccur :: Int -> [Int] -> Int
+numOccur i is = length $ filter (i ==) is
+
diff --git a/tests/ghc-regress/perf/should_run/all.T 
b/tests/ghc-regress/perf/should_run/all.T
index 1886d43..f1d918d 100644
--- a/tests/ghc-regress/perf/should_run/all.T
+++ b/tests/ghc-regress/perf/should_run/all.T
@@ -90,14 +90,20 @@ test('MethSharing',
      compile_and_run,
      ['-O'])
 test('T2902',
-     [normal,
-      extra_clean(['T2902_A',    'T2902_B',
-                   'T2902_A.hi', 'T2902_B.hi',
-                   'T2902_A.o',  'T2902_B.o',
-                   'T2902_A_PairingSum.hi', 'T2902_B_PairingSum.hi',
-                   'T2902_A_PairingSum.o',  'T2902_B_PairingSum.o',
-                   'T2902_Sum.hi',
-                   'T2902_Sum.o'])],
+     extra_clean(['T2902_A',    'T2902_B',
+                  'T2902_A.hi', 'T2902_B.hi',
+                  'T2902_A.o',  'T2902_B.o',
+                  'T2902_A_PairingSum.hi', 'T2902_B_PairingSum.hi',
+                  'T2902_A_PairingSum.o',  'T2902_B_PairingSum.o',
+                  'T2902_Sum.hi',
+                  'T2902_Sum.o']),
      run_command,
      ['$MAKE -s --no-print-directory T2902'])
+test('T149',
+     [expect_broken(149),
+      extra_clean(['T149_A',    'T149_B',
+                   'T149_A.hi', 'T149_B.hi',
+                   'T149_A.o',  'T149_B.o'])],
+     run_command,
+     ['$MAKE -s --no-print-directory T149'])
 
diff --git a/tests/ghc-regress/simplCore/should_run/all.T 
b/tests/ghc-regress/simplCore/should_run/all.T
index 82b1c59..a4a2e6c 100644
--- a/tests/ghc-regress/simplCore/should_run/all.T
+++ b/tests/ghc-regress/simplCore/should_run/all.T
@@ -15,9 +15,6 @@ test('simplrun003', normal, compile_and_run, [''])
 test('simplrun004', normal, compile_and_run, [''])
 test('simplrun005', normal, compile_and_run, [''])
 
-test('simplrun006', expect_fail, compile_and_run, [''])
-  # This is a CSE test
-
 test('simplrun007', normal, compile_and_run, [''])
 test('simplrun008', normal, compile_and_run, [''])
 test('simplrun009', normal, compile_and_run, [''])
diff --git a/tests/ghc-regress/simplCore/should_run/simplrun006.hs 
b/tests/ghc-regress/simplCore/should_run/simplrun006.hs
deleted file mode 100644
index 0e43e9c..0000000
--- a/tests/ghc-regress/simplCore/should_run/simplrun006.hs
+++ /dev/null
@@ -1,44 +0,0 @@
-module Main (main) where
-
--- See Trac #149
-
--- Curently (with GHC 7.0) the CSE works, just,
--- but it's delicate.
-
-
-import System.CPUTime
-
-main = do start <- getCPUTime
-          putStrLn "Start"
-          print $ playerMostOccur1 [1..m]
-          middle <- getCPUTime
-          putStrLn "Middle"
-          print $ playerMostOccur2 [1..m]
-          end <- getCPUTime
-          putStrLn "End"
-          let d1 = middle - start
-              d2 = end - middle
-          if d1 > 2 * d2
-            then do print d1
-                    print d2
-            else putStrLn "OK!"
-
-m :: Int
-m = 22
-
-playerMostOccur1 :: [Int] -> Int
-playerMostOccur1 [a] = a
-playerMostOccur1 (x:xs)
- | numOccur x (x:xs) > numOccur (playerMostOccur1 xs) xs = x
- | otherwise = playerMostOccur1 xs
-
-playerMostOccur2 :: [Int] -> Int
-playerMostOccur2 [a] = a
-playerMostOccur2 (x:xs)
- | numOccur x (x:xs) > numOccur pmo xs = x
- | otherwise = pmo
-    where pmo = playerMostOccur2 xs
-
-numOccur :: Int -> [Int] -> Int
-numOccur i is = length $ filter (i ==) is
-
diff --git a/tests/ghc-regress/simplCore/should_run/simplrun006.stdout 
b/tests/ghc-regress/simplCore/should_run/simplrun006.stdout
deleted file mode 100644
index 81857ee..0000000
--- a/tests/ghc-regress/simplCore/should_run/simplrun006.stdout
+++ /dev/null
@@ -1,6 +0,0 @@
-Start
-22
-Middle
-22
-End
-OK!



_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to