-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Testsuite update for unboxed tuples in arguments
- Loading branch information
1 parent
b757825
commit 5b5c144
Showing
30 changed files
with
129 additions
and
170 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,8 +1,8 @@ | |||
|
|
||
tcfail159.hs:9:11: | tcfail159.hs:9:11: | ||
Couldn't match kind `*' against `(#)' | Couldn't match kind `*' against `#' | ||
Kind incompatibility when matching types: | Kind incompatibility when matching types: | ||
t0 :: * | t0 :: * | ||
(# Int, Int #) :: (#) | (# Int, Int #) :: # | ||
In the pattern: ~(# p, q #) | In the pattern: ~(# p, q #) | ||
In a case alternative: ~(# p, q #) -> p | In a case alternative: ~(# p, q #) -> p |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,17 @@ | |||
{-# LANGUAGE MagicHash, UnboxedTuples, BangPatterns #-} | |||
module Main where | |||
|
|||
import GHC.Exts | |||
|
|||
{-# NOINLINE foo1 #-} -- Make it harder to get right | |||
foo1 x = (# x,x #) | |||
|
|||
{-# NOINLINE foo2 #-} -- Make it harder to get right | |||
foo2 x = (# x, (# True, False #) #) | |||
|
|||
{-# NOINLINE foo3 #-} -- Make it harder to get right | |||
foo3 (# x,y #) = x | |||
|
|||
main = print $ foo3 (# if b then x + y else x - y, 30 #) | |||
where (# x, _ #) = foo1 10 | |||
(# y, (# b, _ #) #) = foo2 20 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1 @@ | |||
30 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,12 @@ | |||
{-# LANGUAGE MagicHash, UnboxedTuples, BangPatterns #-} | |||
module Main where | |||
|
|||
import GHC.Exts | |||
|
|||
{-# NOINLINE foo #-} -- Make it harder to get right | |||
foo :: Double# -> (# (# Double#, Double# #), Double# #) | |||
foo x = (# (# x, x #), x #) | |||
|
|||
main :: IO () | |||
main = case foo 1.0## of | |||
(# (# x, y #), z #) -> print (D# x + D# y + D# z) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1 @@ | |||
3.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,16 @@ | |||
{-# LANGUAGE UnboxedTuples #-} | |||
|
|||
-- !!! Check that unboxed tuples can be function arguments | |||
module Main where | |||
|
|||
data Ex = Ex (# Int,Int #) | |||
|
|||
{-# NOINLINE f #-} -- Make it harder to get right | |||
f :: (# Int,Int #) -> Int | |||
f x = error "urk" | |||
|
|||
{-# NOINLINE g #-} -- Make it harder to get right | |||
g (Ex (# x,y #)) = x | |||
|
|||
|
|||
main = print $ g (Ex (# 10, f (# 20, 30 #) #)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1 @@ | |||
10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,13 @@ | |||
{-# LANGUAGE MagicHash, UnboxedTuples #-} | |||
|
|||
module Main where | |||
|
|||
import GHC.Prim (Int#, Double#) | |||
|
|||
main :: IO () | |||
main = let f = int2Integer# 0# in putStrLn "" | |||
|
|||
|
|||
{-# NOINLINE int2Integer# #-} | |||
int2Integer# :: Int# -> (# Int#, Double# #) | |||
int2Integer# x = (# x, 1.0## #) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1 @@ | |||
|
Oops, something went wrong.