summaryrefslogtreecommitdiff
path: root/testsuite/tests/determinism/determ003/all.T
diff options
context:
space:
mode:
authorBartosz Nitka <niteria@gmail.com>2015-10-30 23:40:21 +0100
committerBen Gamari <ben@smart-cactus.org>2015-10-30 23:40:34 +0100
commita5cb27f323a0c78f61db1a3c5338045b0981850b (patch)
tree91eb409d2cc10b00840f8c783744fc1e3939c1ad /testsuite/tests/determinism/determ003/all.T
parentfce758c5a5a54e8cfa491c5168893854bf7e974d (diff)
downloadhaskell-a5cb27f323a0c78f61db1a3c5338045b0981850b.tar.gz
Make type-class dictionary let binds deterministic
When generating dictionary let binds in dsTcEvBinds we may end up generating them in arbitrary order according to Unique order. Consider: ``` let $dEq = GHC.Classes.$fEqInt in let $$dNum = GHC.Num.$fNumInt in ... ``` vs ``` let $dNum = GHC.Num.$fNumInt in let $dEq = GHC.Classes.$fEqInt in ... ``` The way this change fixes it is by using `UniqDFM` - a type of deterministic finite maps of things keyed on `Unique`s. This way when you pull out evidence variables corresponding to type-class dictionaries they are in deterministic order. Currently it's the order of insertion and the way it's implemented is by tagging the values with the time of insertion. Test Plan: I've added a new test case to reproduce the issue. ./validate Reviewers: ezyang, simonmar, austin, simonpj, bgamari Reviewed By: simonmar, simonpj, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1396 GHC Trac Issues: #4012
Diffstat (limited to 'testsuite/tests/determinism/determ003/all.T')
-rw-r--r--testsuite/tests/determinism/determ003/all.T4
1 files changed, 4 insertions, 0 deletions
diff --git a/testsuite/tests/determinism/determ003/all.T b/testsuite/tests/determinism/determ003/all.T
new file mode 100644
index 0000000000..c00544d51a
--- /dev/null
+++ b/testsuite/tests/determinism/determ003/all.T
@@ -0,0 +1,4 @@
+test('determ003',
+ extra_clean(['A.o', 'A.hi', 'A.normal.hi']),
+ run_command,
+ ['$MAKE -s --no-print-directory determ003'])