summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--testsuite/tests/simplCore/should_compile/T16588.hs13
-rw-r--r--testsuite/tests/simplCore/should_compile/T16588.stderr12
-rw-r--r--testsuite/tests/simplCore/should_compile/all.T3
3 files changed, 27 insertions, 1 deletions
diff --git a/testsuite/tests/simplCore/should_compile/T16588.hs b/testsuite/tests/simplCore/should_compile/T16588.hs
new file mode 100644
index 0000000000..1bc7b327c5
--- /dev/null
+++ b/testsuite/tests/simplCore/should_compile/T16588.hs
@@ -0,0 +1,13 @@
+-- Tests that the noinline doesn't hide functions' demand signatures from the
+-- demand analysis. See #16588.
+
+module T16588 where
+
+import GHC.Magic
+
+func :: a -> a
+func x = x
+
+-- This should place a strict demand on its argument.
+func2 :: Integer -> Integer
+func2 x = noinline func x
diff --git a/testsuite/tests/simplCore/should_compile/T16588.stderr b/testsuite/tests/simplCore/should_compile/T16588.stderr
new file mode 100644
index 0000000000..20e7125d45
--- /dev/null
+++ b/testsuite/tests/simplCore/should_compile/T16588.stderr
@@ -0,0 +1,12 @@
+
+==================== Strictness signatures ====================
+T16588.$trModule: m
+T16588.func: <S,1*U>
+T16588.func2: <S,1*U>
+
+
+
+==================== Strictness signatures ====================
+T16588.$trModule: m
+T16588.func: <S,1*U>
+T16588.func2: <S,1*U>
diff --git a/testsuite/tests/simplCore/should_compile/all.T b/testsuite/tests/simplCore/should_compile/all.T
index 35933e8be4..d22a00293f 100644
--- a/testsuite/tests/simplCore/should_compile/all.T
+++ b/testsuite/tests/simplCore/should_compile/all.T
@@ -308,7 +308,8 @@ test('T16918a', normal, compile, ['-O'])
test('T16978', normal, compile, ['-O'])
test('T16979a', normal, compile, ['-O'])
test('T16979b', normal, compile, ['-O'])
+test('T16588', normal, compile, ['-O -ddump-str-signatures'])
test('T17140',
[extra_files(['T17140a.hs'])],
makefile_test,
- ['T17140']) \ No newline at end of file
+ ['T17140'])