diff options
author | David Terei <davidterei@gmail.com> | 2011-07-20 11:09:03 -0700 |
---|---|---|
committer | David Terei <davidterei@gmail.com> | 2011-07-20 11:26:35 -0700 |
commit | 16514f272fb42af6e9c7674a9bd6c9dce369231f (patch) | |
tree | e4f332b45fe65e2a7a2451be5674f887b42bf199 /testsuite/tests/codeGen/should_run/cgrun012.hs | |
parent | ebd422aed41048476aa61dd4c520d43becd78682 (diff) | |
download | haskell-16514f272fb42af6e9c7674a9bd6c9dce369231f.tar.gz |
Move tests from tests/ghc-regress/* to just tests/*
Diffstat (limited to 'testsuite/tests/codeGen/should_run/cgrun012.hs')
-rw-r--r-- | testsuite/tests/codeGen/should_run/cgrun012.hs | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/testsuite/tests/codeGen/should_run/cgrun012.hs b/testsuite/tests/codeGen/should_run/cgrun012.hs new file mode 100644 index 0000000000..8fe0a869c4 --- /dev/null +++ b/testsuite/tests/codeGen/should_run/cgrun012.hs @@ -0,0 +1,39 @@ +{-# LANGUAGE MagicHash #-} +-- !!! move arguments around on the stacks, mainly the B stack + +import GHC.Base ( Float#, Double#, Int#, Int(..) ) + + +main = print foo + +foo = I# + ( f 1.1## + 2.1# + True + 3.1## + 4.1# + 5.1## + 6.1## + 42# -- the answer! + 7.1# + 8.1# ) + where + f :: Double# -> Float# -> Bool -> Double# -> Float# + -> Double# -> Double# -> Int# -> Float# -> Float# + -> Int# + f b1 s2 t b3 s4 b5 b6 i42 s7 s8 + -- evens, then odds + = g s2 b3 b5 i42 s8 b1 t s4 b6 s7 + + g :: Float# -> Double# -> Double# -> Int# -> Float# + -> Double# -> Bool -> Float# -> Double# -> Float# + -> Int# + g s2 b3 b5 i42 s8 b1 t s4 b6 s7 + -- powers of 2 backwards, then others forwards + = h s7 b6 t b5 s2 b3 i42 s8 b1 s4 + + h :: Float# -> Double# -> Bool -> Double# -> Float# + -> Double# -> Int# -> Float# -> Double# -> Float# + -> Int# + h s7 b6 t b5 s2 b3 i42 s8 b1 s4 + = i42 |