Skip to content
GitLab
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
02a381cc
Commit
02a381cc
authored
Mar 30, 2007
by
simonpj
Browse files
Test for RULES type-matching
parent
6d82c8e5
Changes
3
Hide whitespace changes
Inline
Side-by-side
testsuite/tests/ghc-regress/simplCore/should_run/all.T
View file @
02a381cc
...
...
@@ -16,3 +16,4 @@ test('simplrun004', normal, compile_and_run, [''])
test
('
simplrun005
',
normal
,
compile_and_run
,
[''])
test
('
simplrun006
',
expect_broken
(
149
),
compile_and_run
,
[''])
test
('
simplrun007
',
normal
,
compile_and_run
,
[''])
test
('
simplrun008
',
normal
,
compile_and_run
,
[''])
testsuite/tests/ghc-regress/simplCore/should_run/simplrun008.hs
0 → 100644
View file @
02a381cc
{-# OPTIONS -fglasgow-exts -O #-}
module
Main
where
import
Data.Char
{-# NOINLINE f #-}
f
::
Int
->
String
f
x
=
"NOT FIRED"
{-# NOINLINE neg #-}
neg
::
Int
->
Int
neg
=
negate
{-# RULES
"f" forall (c::Char->Int) (x::Char). f (c x) = "RULE FIRED"
#-}
main
=
do
{
print
(
f
(
ord
'a'
))
-- Rule should fire
;
print
(
f
(
neg
1
))
}
-- Rule should not fire
testsuite/tests/ghc-regress/simplCore/should_run/simplrun008.stdout
0 → 100644
View file @
02a381cc
"RULE FIRED"
"NOT FIRED"
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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