summaryrefslogtreecommitdiff
path: root/testsuite/tests
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests')
-rw-r--r--testsuite/tests/simplCore/should_compile/T21801.hs14
-rw-r--r--testsuite/tests/simplCore/should_compile/all.T1
2 files changed, 15 insertions, 0 deletions
diff --git a/testsuite/tests/simplCore/should_compile/T21801.hs b/testsuite/tests/simplCore/should_compile/T21801.hs
new file mode 100644
index 0000000000..28add577ec
--- /dev/null
+++ b/testsuite/tests/simplCore/should_compile/T21801.hs
@@ -0,0 +1,14 @@
+{-# LANGUAGE NoImplicitPrelude #-}
+module Endo where
+
+-- This test threw up a WARNING (in a -DDEBUG compiler)
+-- in GHC.Core.Opt.Arity.tryEtaReduce
+
+newtype Endo a = Endo { appEndo :: a -> a }
+
+foo :: Endo a -> Endo a -> Endo a
+foo (Endo f) (Endo g) = Endo (comp f g)
+
+comp :: (b -> c) -> (a -> b) -> (a -> c)
+comp f g x = f (g x)
+{-# OPAQUE comp #-}
diff --git a/testsuite/tests/simplCore/should_compile/all.T b/testsuite/tests/simplCore/should_compile/all.T
index 2ddbef16bb..ff55f67806 100644
--- a/testsuite/tests/simplCore/should_compile/all.T
+++ b/testsuite/tests/simplCore/should_compile/all.T
@@ -418,3 +418,4 @@ test('T21391a', normal, compile, ['-O -dcore-lint'])
# We don't want to see a thunk allocation for the insertBy expression after CorePrep.
test('T21392', [ grep_errmsg(r'sat.* :: \[\(.*Unique, .*Int\)\]'), expect_broken(21392) ], compile, ['-O -ddump-prep -dno-typeable-binds -dsuppress-uniques'])
test('T21689', [extra_files(['T21689a.hs'])], multimod_compile, ['T21689', '-v0 -O'])
+test('T21801', normal, compile, ['-O -dcore-lint'])