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
ce68b757
Commit
ce68b757
authored
Jul 13, 2012
by
Ian Lynagh
Browse files
Add a couple of tests for gcdInteger
parent
16e79b16
Changes
5
Hide whitespace changes
Inline
Side-by-side
testsuite/tests/lib/integer/Makefile
View file @
ce68b757
...
...
@@ -56,3 +56,9 @@ IntegerConversionRules:
-
grep
-q
integerToWord
$@
.simpl
&&
echo
"integerToWord present"
-
grep
-q
int2Word
$@
.simpl
||
echo
"int2Word absent"
.PHONY
:
T7041
T7041
:
'
$(TEST_HC)
'
-Wall
-v0
-O
-c
$@
.hs
-fforce-recomp
-ddump-simpl
>
$@
.simpl
-
grep
-q
gcdInteger
$@
.simpl
&&
echo
"gcdInteger present"
-
grep
-q
"gcdInt
\>
"
$@
.simpl
||
echo
"gcdInt absent"
testsuite/tests/lib/integer/T7041.hs
0 → 100644
View file @
ce68b757
module
T7041
where
gcdInt
::
Int
->
Int
->
Int
gcdInt
a
b
=
fromInteger
(
gcd
(
toInteger
a
)
(
toInteger
b
))
testsuite/tests/lib/integer/all.T
View file @
ce68b757
...
...
@@ -12,4 +12,9 @@ test('IntegerConversionRules',
extra_clean
(['
IntegerConversionRules.simpl
']),
run_command
,
['
$MAKE -s --no-print-directory IntegerConversionRules
'])
test
('
gcdInteger
',
normal
,
compile_and_run
,
[''])
test
('
T7041
',
extra_clean
(['
T7041.simpl
']),
run_command
,
['
$MAKE -s --no-print-directory T7041
'])
testsuite/tests/lib/integer/gcdInteger.hs
0 → 100644
View file @
ce68b757
{-# LANGUAGE MagicHash #-}
module
Main
(
main
)
where
import
GHC.Base
import
GHC.Integer
main
::
IO
()
main
=
case
i
of
I
#
i
#
->
print
(
gcd
(
smallInteger
i
#
)
(
smallInteger
i
#
))
{-# NOINLINE i #-}
i
::
Int
i
=
minBound
testsuite/tests/lib/integer/gcdInteger.stdout
0 → 100644
View file @
ce68b757
9223372036854775808
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