Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
GHC
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
4,248
Issues
4,248
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
395
Merge Requests
395
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
9ff81c7f
Commit
9ff81c7f
authored
Apr 23, 2012
by
Ian Lynagh
Browse files
Options
Browse Files
Download
Plain Diff
Merge nb:ghc/git/ghc/testsuite
parents
ef0d0b70
b13a295c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
0 deletions
+38
-0
testsuite/tests/numeric/should_run/all.T
testsuite/tests/numeric/should_run/all.T
+1
-0
testsuite/tests/numeric/should_run/quotRem2.hs
testsuite/tests/numeric/should_run/quotRem2.hs
+34
-0
testsuite/tests/numeric/should_run/quotRem2.stdout
testsuite/tests/numeric/should_run/quotRem2.stdout
+3
-0
No files found.
testsuite/tests/numeric/should_run/all.T
View file @
9ff81c7f
...
...
@@ -56,4 +56,5 @@ test('4383', normal, compile_and_run, [''])
test
('
add2
',
normal
,
compile_and_run
,
[''])
test
('
mul2
',
normal
,
compile_and_run
,
[''])
test
('
quotRem2
',
normal
,
compile_and_run
,
[''])
testsuite/tests/numeric/should_run/quotRem2.hs
0 → 100644
View file @
9ff81c7f
{-# LANGUAGE MagicHash, UnboxedTuples #-}
import
GHC.Prim
import
GHC.Word
import
Control.Monad
import
Data.Bits
main
::
IO
()
main
=
do
f
5
6
23
f
0x80000000
0
0x80000001
f
0xFC1D8A3BFB29FC6A
49
0xFD94E3B7FE36FB18
f
::
Word
->
Word
->
Word
->
IO
()
f
wxHigh
@
(
W
#
xHigh
)
wxLow
@
(
W
#
xLow
)
wy
@
(
W
#
y
)
=
do
when
debugging
$
putStrLn
"-----"
when
debugging
$
putStrLn
(
"Doing "
++
show
(
wxHigh
,
wxLow
)
++
" `quotRem` "
++
show
wy
)
let
ix
=
(
toInteger
wxHigh
`
shiftL
`
bitSize
wxHigh
)
.|.
toInteger
wxLow
wanted
=
ix
`
quotRem
`
toInteger
wy
when
debugging
$
putStrLn
(
"Wanted: "
++
show
wanted
)
case
quotRemWord2
#
xHigh
xLow
y
of
(
#
q
,
r
#
)
->
do
let
wq
=
W
#
q
wr
=
W
#
r
got
=
(
toInteger
wq
,
toInteger
wr
)
when
debugging
$
putStrLn
(
"Got: "
++
show
got
)
if
wanted
==
got
then
putStrLn
"Worked"
else
putStrLn
"Failed"
debugging
::
Bool
debugging
=
False
testsuite/tests/numeric/should_run/quotRem2.stdout
0 → 100644
View file @
9ff81c7f
Worked
Worked
Worked
Write
Preview
Markdown
is supported
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