Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Alex D
GHC
Commits
377672ae
Commit
377672ae
authored
Jan 27, 2014
by
Joachim Breitner
Browse files
Test case for RULE map coerce = coerce
(This tests #2110.)
parent
8f16233c
Changes
3
Hide whitespace changes
Inline
Side-by-side
testsuite/tests/simplCore/should_run/T2110.hs
0 → 100644
View file @
377672ae
{-# LANGUAGE MagicHash #-}
import
GHC.Exts
import
Unsafe.Coerce
{-# RULES
"map/coerce" map coerce = coerce
#-}
newtype
Age
=
Age
Int
fooAge
::
[
Int
]
->
[
Age
]
fooAge
=
map
Age
fooCoerce
::
[
Int
]
->
[
Age
]
fooCoerce
=
map
coerce
fooUnsafeCoerce
::
[
Int
]
->
[
Age
]
fooUnsafeCoerce
=
map
unsafeCoerce
same
::
a
->
b
->
IO
()
same
x
y
=
case
reallyUnsafePtrEquality
#
(
unsafeCoerce
x
)
y
of
1
#
->
putStrLn
"yes"
_
->
putStrLn
"no"
main
=
do
let
l
=
[
1
,
2
,
3
]
same
(
fooAge
l
)
l
same
(
fooCoerce
l
)
l
same
(
fooUnsafeCoerce
l
)
l
testsuite/tests/simplCore/should_run/T2110.stdout
0 → 100644
View file @
377672ae
yes
yes
yes
testsuite/tests/simplCore/should_run/all.T
View file @
377672ae
...
...
@@ -51,6 +51,7 @@ test('T5453', normal, compile_and_run, [''])
test
('
T5441
',
extra_clean
(['
T5441a.o
','
T5441a.hi
']),
multimod_compile_and_run
,
['
T5441
',''])
test
('
T5603
',
normal
,
compile_and_run
,
[''])
test
('
T2110
',
expect_broken
(
2110
),
compile_and_run
,
[''])
# Run these tests *without* optimisation too
test
('
T5625
',
[
only_ways
(['
normal
','
optasm
']),
exit_code
(
1
)
],
compile_and_run
,
[''])
...
...
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