[project @ 1999-01-23 18:10:00 by sof]
[ghc-hetmet.git] / ghc / tests / codeGen / should_run / cg012.hs
1 -- !!! move arguments around on the stacks, mainly the B stack
2
3 import PrelBase ( Float#, Double#, Int#, Int(..) )
4
5
6 main = print foo
7
8 foo = I#
9         ( f 1.1##
10             2.1#
11             True
12             3.1##
13             4.1#
14             5.1##
15             6.1##
16             42# -- the answer!
17             7.1#
18             8.1# )
19     where
20       f :: Double# -> Float# -> Bool -> Double# -> Float#
21         -> Double# -> Double# -> Int# -> Float# -> Float#
22         -> Int#
23       f b1 s2 t b3 s4 b5 b6 i42 s7 s8
24         -- evens, then odds
25         = g s2 b3 b5 i42 s8 b1 t s4 b6 s7
26
27       g :: Float# -> Double# -> Double# -> Int# -> Float#
28         -> Double# -> Bool -> Float# -> Double# -> Float#
29         -> Int#
30       g s2 b3 b5 i42 s8 b1 t s4 b6 s7
31         -- powers of 2 backwards, then others forwards
32         = h s7 b6 t b5 s2 b3 i42 s8 b1 s4
33
34       h :: Float# -> Double# -> Bool -> Double# -> Float#
35         -> Double# -> Int# -> Float# -> Double# -> Float#
36         -> Int#
37       h s7 b6 t b5 s2 b3 i42 s8 b1 s4
38         = i42