Skip to content
GitLab
Menu
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
ef9249ee
Commit
ef9249ee
authored
Jan 18, 2012
by
dterei
Browse files
Add test for
#5785
.
parent
0998987c
Changes
3
Show whitespace changes
Inline
Side-by-side
testsuite/tests/codeGen/should_run/5785.hs
0 → 100644
View file @
ef9249ee
module
Main
where
import
Data.Int
import
Data.Word
-- Test case for bug #5785. The cause of this was that the LLVM backend
-- converted all Int constants using (fromInteger :: Int) and so on 32bit a
-- Int64 or Word32 would be truncated to 32bit! value before printing out.
main
::
IO
()
main
=
do
-- first two should print as big numbers (as unsigned)
print
(
-
1
::
Word8
)
print
(
-
1
::
Word16
)
print
(
-
1
::
Word32
)
print
(
-
1
::
Word64
)
print
(
-
1
::
Int8
)
print
(
-
1
::
Int16
)
print
(
-
1
::
Int32
)
print
(
-
1
::
Int64
)
-- only requires 32 bits (unsigned)
print
(
2316287658
::
Word8
)
print
(
2316287658
::
Word16
)
print
(
2316287658
::
Word32
)
print
(
2316287658
::
Word64
)
print
(
2316287658
::
Int8
)
print
(
2316287658
::
Int16
)
print
(
2316287658
::
Int32
)
print
(
2316287658
::
Int64
)
-- this requries a 64 (unsigned) bit word to store correctly
print
(
32342316287658
::
Word8
)
print
(
32342316287658
::
Word16
)
print
(
32342316287658
::
Word32
)
print
(
32342316287658
::
Word64
)
print
(
32342316287658
::
Int8
)
print
(
32342316287658
::
Int16
)
print
(
32342316287658
::
Int32
)
print
(
32342316287658
::
Int64
)
testsuite/tests/codeGen/should_run/5785.stdout
0 → 100644
View file @
ef9249ee
255
65535
4294967295
18446744073709551615
-1
-1
-1
-1
170
48810
2316287658
2316287658
-86
-16726
-1978679638
2316287658
170
1706
1212548778
32342316287658
-86
1706
1212548778
32342316287658
testsuite/tests/codeGen/should_run/all.T
View file @
ef9249ee
...
...
@@ -88,3 +88,5 @@ test('5149', omit_ways(['ghci']), multi_compile_and_run,
test
('
5129
',
normal
,
compile_and_run
,
[''])
test
('
5626
',
exit_code
(
1
),
compile_and_run
,
[''])
test
('
5747
',
if_arch
('
i386
',
extra_hc_opts
('
-msse2
')),
compile_and_run
,
['
-O2
'])
test
('
5785
',
normal
,
compile_and_run
,
[''])
Write
Preview
Supports
Markdown
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