summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoachim Breitner <mail@joachim-breitner.de>2014-01-14 09:36:34 +0000
committerJoachim Breitner <breitner@kit.edu>2014-02-04 16:20:09 +0100
commit3336339b03e5961a3064c43a8ab062f080b6ef55 (patch)
treed74348dbee6a583a685f4a02f65cedc2cbbaf788
parent2e6a0d80451a0f3e5d676c5424a82859b1974a60 (diff)
downloadhaskell-3336339b03e5961a3064c43a8ab062f080b6ef55.tar.gz
CPR test case: Case binder CPR
-rw-r--r--testsuite/tests/stranal/sigs/CaseBinderCPR.hs15
-rw-r--r--testsuite/tests/stranal/sigs/CaseBinderCPR.stderr5
-rw-r--r--testsuite/tests/stranal/sigs/all.T1
3 files changed, 21 insertions, 0 deletions
diff --git a/testsuite/tests/stranal/sigs/CaseBinderCPR.hs b/testsuite/tests/stranal/sigs/CaseBinderCPR.hs
new file mode 100644
index 0000000000..13f216347d
--- /dev/null
+++ b/testsuite/tests/stranal/sigs/CaseBinderCPR.hs
@@ -0,0 +1,15 @@
+module CaseBinderCPR where
+
+-- This example, taken from nofib's transform (and heavily reduced) ensures that
+-- CPR information is added to a case binder
+
+f_list_cmp::(t1 -> t1 -> Int) -> [t1] -> [t1] -> Int;
+f_list_cmp a_cmp [] []= 0
+f_list_cmp a_cmp [] a_ys= -1
+f_list_cmp a_cmp a_xs []= 1
+f_list_cmp a_cmp (a_x:a_xs) (a_y:a_ys)=
+ if r_order == 0
+ then f_list_cmp a_cmp a_xs a_ys
+ else r_order
+ where
+ r_order = a_cmp a_x a_y
diff --git a/testsuite/tests/stranal/sigs/CaseBinderCPR.stderr b/testsuite/tests/stranal/sigs/CaseBinderCPR.stderr
new file mode 100644
index 0000000000..f2ea61d178
--- /dev/null
+++ b/testsuite/tests/stranal/sigs/CaseBinderCPR.stderr
@@ -0,0 +1,5 @@
+
+==================== Strictness signatures ====================
+CaseBinderCPR.f_list_cmp: <L,C(C1(U(U)))><S,1*U><S,1*U>m()
+
+
diff --git a/testsuite/tests/stranal/sigs/all.T b/testsuite/tests/stranal/sigs/all.T
index 9d36479c17..81a8d4b1b8 100644
--- a/testsuite/tests/stranal/sigs/all.T
+++ b/testsuite/tests/stranal/sigs/all.T
@@ -15,3 +15,4 @@ test('FacState', expect_broken(1600), compile, [''])
test('UnsatFun', normal, compile, [''])
test('BottomFromInnerLambda', normal, compile, [''])
test('DmdAnalGADTs', normal, compile, [''])
+test('CaseBinderCPR', normal, compile, [''])