summaryrefslogtreecommitdiff
path: root/testsuite/tests/stranal/should_compile/T18894b.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/stranal/should_compile/T18894b.hs')
-rw-r--r--testsuite/tests/stranal/should_compile/T18894b.hs12
1 files changed, 11 insertions, 1 deletions
diff --git a/testsuite/tests/stranal/should_compile/T18894b.hs b/testsuite/tests/stranal/should_compile/T18894b.hs
index e90f34e3fd..99a4bf954d 100644
--- a/testsuite/tests/stranal/should_compile/T18894b.hs
+++ b/testsuite/tests/stranal/should_compile/T18894b.hs
@@ -17,4 +17,14 @@ f :: Int -> Int
f 1 = 0
f m
| odd m = eta m 2
- | otherwise = eta 2 m
+ | otherwise = eta m m
+
+{-
+An earlier version of this test had (eta 2 m) in the otherwise case.
+But then (eta 2) could be floated out; and indeed if 'f' is applied
+many times, then sharing (eta 2) might be good. And if we inlined
+eta, we certainly would share (expensive 2).
+
+So I made the test more robust at testing what we actually want here,
+by changing to (eta m m).
+-}