Commit 1dce8845 authored by sewardj's avatar sewardj
Browse files

[project @ 2001-06-20 15:11:17 by sewardj]

All your codeGen tests are belong to me.  Well, the should_run ones,
at least.
parent 23f574d4
include ($confdir ++ "/../vanilla-test.T")
-- Args to vt are: extra compile flags
-- extra run flags
-- expected process return value, if not zero
test "cg001" { vt("", "", "") }
test "cg002" { vt("", "", "") }
test "cg003" { vt("", "", "") }
test "cg004" { vt("", "", "") }
test "cg005" { vt("", "", "") }
test "cg006" { vt("", "", "") }
test "cg007" { vt("", "", "") }
test "cg008" { vt("", "", "") }
test "cg009" { vt("", "", "") }
test "cg010" { vt("", "", "") }
test "cg011" { vt("", "", "") }
test "cg012" { vt("-fglasgow-exts", "", "") }
test "cg013" { vt("", "", "") }
test "cg014" { vt("", "", "") }
test "cg015" { vt("-fglasgow-exts", "", "") }
test "cg016" { vt("", "", "1") }
test "cg017" { vt("", "", "") }
test "cg018" { vt("-fglasgow-exts", "", "") }
test "cg019" { vt("", "", "") }
test "cg020" { vt("", "", "") }
test "cg021" { vt("", "", "") }
test "cg022" { vt("", "", "") }
test "cg023" { vt("", "", "") }
test "cg024" { vt("", "", "") }
test "cg025" { vt("-package lang -package text", "", "1") }
test "cg026" { vt("-package lang -fglasgow-exts -fvia-C", "", "") }
test "cg027" { vt("", "", "") }
test "cg028" { vt("", "", "") }
test "cg029" { vt("-package lang -fglasgow-exts", "", "") }
test "cg030" { vt("-package lang -fglasgow-exts", "", "") }
test "cg031" { vt("-fglasgow-exts", "", "") }
test "cg032" { vt("-fglasgow-exts", "", "") }
test "cg033" { vt("-fglasgow-exts", "", "") }
test "cg034" { vt("", "", "") }
test "cg035" { vt("-package lang -fglasgow-exts", "", "") }
test "cg036" { vt("", "", "") }
test "cg037" { vt("", "", "") }
test "cg038" { vt("", "", "") }
test "cg039" { vt("", "", "") }
test "cg040" { vt("", "", "") }
test "cg041" { vt("", "", "") }
test "cg042" { vt("-package lang -fglasgow-exts", "", "") }
test "cg043" { vt("", "", "") }
test "cg044" { vt("-package lang", "", "" ) }
-- tmp, until we fix the problems with seq#...
test "cg045" { vt( "-O", "", "1") }
test "cg046" { vt("", "", "") }
test "cg047" { vt("", "", "") }
test "cg048" { vt("", "", "") }
test "cg049" { vt( "-funbox-strict-fields", "", "") }
-- !! cg001: main = -42 -- take 1
main = print ( f () )
where
f :: a -> Int
f x = -42
main = print ((f id2) (10 + thirty_two))
where
f x = g x
where
g x = h x
where
h x = x
thirty_two :: Int
thirty_two = 32
id2 x = x
main = print (id2 (id2 id2) (42::Int))
-- where
-- id2 = s k k
-- id2 x = s k k x
id2 = s k k
s x y z = x z (y z)
k x y = x
main = print (length ([9,8,7,6,5,4,3,2,1] :: [Int]))
-- !! answer: 65532
main = print foo
foo :: Int
foo = ((1 + 2 + 32767 - 4) * 6) --later? `div` 3
main = print (length thirteen_ones)
where
thirteen_ones = take (13::Int) ones
ones :: [Int]
ones = 1 : ones
data Tree a = Leaf a | Branch (Tree a) (Tree a)
main = print (height our_tree)
where
our_tree :: Tree Int
our_tree =
Branch (Branch (Leaf 1) (Branch (Branch (Leaf 1) (Leaf 1)) (Leaf 1)))
(Branch (Leaf 1) (Leaf 1))
height :: Tree a -> Int
height (Leaf _) = 1
height (Branch t1 t2) = 1 + max (height t1) (height t2)
main = print (length comp_list)
where
comp_list :: [(Int,Int)]
comp_list = [ (elem1,elem2)
| elem1 <- given_list,
elem2 <- given_list,
elem1 >= (4::Int),
elem2 < (3::Int)
]
given_list :: [Int]
given_list = [1,2,3,4,5,6,7,8,9]
main = print (length take_list)
where
take_list :: [Int]
take_list = takeWhile (\ x -> x < 6) given_list
given_list :: [Int]
given_list = [1,2,3,4,5,6,7,8,9]
main = print a
where
a :: Int
b :: Int
(a, b) = (3 + 4, 5 + 6)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment