summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2019-09-16 11:34:42 -0400
committerBen Gamari <ben@smart-cactus.org>2019-09-19 09:33:04 -0400
commit48e914d5bcfbcdb8cf3a3ee69c9d6a6d7dd1b225 (patch)
tree22417017f9b92c1315ca8207395fb9b19a90ab0d
parentb21d653577e01c3c06f5214e2a97ffa28e5339c8 (diff)
downloadhaskell-wip/no-inline-strictness.tar.gz
testsuite: Add test for strictness of noinlinewip/no-inline-strictness
This verifies that noinline propagates the demands of its argument, as described in #16588.
-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'])