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
71bb7800
Commit
71bb7800
authored
Jun 27, 2012
by
Ian Lynagh
Browse files
Add IntegerConversionRules
Includes a test for the problem in #6111.
parent
a6bacc3e
Changes
3
Hide whitespace changes
Inline
Side-by-side
testsuite/tests/lib/integer/IntegerConversionRules.hs
0 → 100644
View file @
71bb7800
module
IntegerConversionRules
where
import
Data.Word
f1
::
Int
->
Double
f1
=
fi
f2
::
Int
->
Float
f2
=
fi
f3
::
Int
->
Int
f3
=
fi
f4
::
Int
->
Word
f4
=
fi
fi
::
(
Integral
a
,
Num
b
)
=>
a
->
b
fi
=
fromIntegral
testsuite/tests/lib/integer/Makefile
View file @
71bb7800
...
...
@@ -45,3 +45,14 @@ fromToInteger:
-grep
integerToWord
fromToInteger.simpl
-grep
wordToInteger
fromToInteger.simpl
.PHONY
:
IntegerConversionRules
IntegerConversionRules
:
'
$(TEST_HC)
'
-Wall
-v0
-O
-c
$@
.hs
-fforce-recomp
-ddump-simpl
>
$@
.simpl
-
grep
-q
smallInteger
$@
.simpl
&&
echo
"smallInteger present"
-
grep
-q
doubleFromInteger
$@
.simpl
&&
echo
"doubleFromInteger present"
-
grep
-q
int2Double
$@
.simpl
||
echo
"int2Double absent"
-
grep
-q
floatFromInteger
$@
.simpl
&&
echo
"floatFromInteger present"
-
grep
-q
int2Float
$@
.simpl
||
echo
"int2Float absent"
-
grep
-q
integerToWord
$@
.simpl
&&
echo
"integerToWord present"
-
grep
-q
int2Word
$@
.simpl
||
echo
"int2Word absent"
testsuite/tests/lib/integer/all.T
View file @
71bb7800
...
...
@@ -8,4 +8,8 @@ test('fromToInteger',
extra_clean
(['
fromToInteger.simpl
']),
run_command
,
['
$MAKE -s --no-print-directory fromToInteger
'])
test
('
IntegerConversionRules
',
extra_clean
(['
IntegerConversionRules.simpl
']),
run_command
,
['
$MAKE -s --no-print-directory IntegerConversionRules
'])
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