[project @ 2000-06-12 19:57:40 by panne]
[ghc-hetmet.git] / ghc / tests / codeGen / should_run / cg018.hs
1 -- !!! test of datatype with many unboxed fields
2 --
3 import PrelGHC( Float# )
4 import PrelFloat
5
6 -- This test is a little bit numerically unstable, so compare only a small prefix.
7 -- Otherwise you get slightly different results with and without optimization.
8 main = putStrLn (take 6 (shows (selectee1 + selectee2) ""))
9
10 data Tfo = Tfo Float# Float# Float# Float# Float# Float# Float# Float# Float# Float# Float# Float#
11
12 yyy = (Tfo (-0.0018#)  (-0.8207#)   (0.5714#)
13             (0.2679#)  (-0.5509#)  (-0.7904#)
14             (0.9634#)   (0.1517#)   (0.2209#)
15             (0.0073#)   (8.4030#)   (0.6232#))
16
17 xxx = (Tfo (-0.8143#)  (-0.5091#)  (-0.2788#)
18            (-0.0433#)  (-0.4257#)   (0.9038#)
19            (-0.5788#)   (0.7480#)   (0.3246#)
20             (1.5227#)   (6.9114#)  (-7.0765#))
21
22 selectee1 = F# (case xxx of
23                   Tfo _ _ _ _ _ _ _ x _ _ _ _ -> x)
24
25 selectee2 = F# (case xxx of
26                   Tfo _ _ y _ _ _ _ _ _ _ _ _ -> y)