Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
4c1bca1b
Commit
4c1bca1b
authored
Apr 17, 2011
by
Ian Lynagh
Browse files
Replace simplrun006 with a less fragile perf test T149
parent
67b2af08
Changes
6
Hide whitespace changes
Inline
Side-by-side
testsuite/tests/ghc-regress/perf/should_run/Makefile
View file @
4c1bca1b
...
...
@@ -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"
testsuite/tests/ghc-regress/perf/should_run/T149_A.hs
0 → 100644
View file @
4c1bca1b
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
testsuite/tests/ghc-regress/
simplCore
/should_run/
simplrun006
.hs
→
testsuite/tests/ghc-regress/
perf
/should_run/
T149_B
.hs
View file @
4c1bca1b
...
...
@@ -8,30 +8,12 @@ module Main (main) where
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!"
main
::
IO
()
main
=
print
$
playerMostOccur2
[
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
playerMostOccur2
::
[
Int
]
->
Int
playerMostOccur2
[
a
]
=
a
playerMostOccur2
(
x
:
xs
)
...
...
testsuite/tests/ghc-regress/perf/should_run/all.T
View file @
4c1bca1b
...
...
@@ -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
'])
testsuite/tests/ghc-regress/simplCore/should_run/all.T
View file @
4c1bca1b
...
...
@@ -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
,
[''])
...
...
testsuite/tests/ghc-regress/simplCore/should_run/simplrun006.stdout
deleted
100644 → 0
View file @
67b2af08
Start
22
Middle
22
End
OK!
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment