Fix #13807 - foreign import nondeterminism
authorBartosz Nitka <niteria@gmail.com>
Mon, 12 Jun 2017 21:02:44 +0000 (17:02 -0400)
committerBen Gamari <ben@smart-cactus.org>
Mon, 12 Jun 2017 21:02:44 +0000 (17:02 -0400)
commitdcdc391609d6ff902989d806266855901c051608
tree3dd3e15b9b5eab3cdd6b6a6c0f0e0a8c20fd9aed
parentf942f65a525dd972cd96e6ae42922b6a3ce4b2d0
Fix #13807 - foreign import nondeterminism

The problem was that the generated label included
a freshly assigned Unique value.

Test Plan:
Added a new test and looked at the generated stub:

```
 #include "HsFFI.h"
 #ifdef __cplusplus
 extern "C" {
 #endif
 extern HsInt zdmainzdAzdAzuzzlzzgzzg(StgStablePtr the_stableptr);
 extern HsInt zdmainzdAzdAzumkStringWriter(StgStablePtr the_stableptr);
 #ifdef __cplusplus
 }
 #endif
```

./validate

Reviewers: simonmar, austin, bgamari

Reviewed By: simonmar

Subscribers: rwbarton, thomie

GHC Trac Issues: #13807

Differential Revision: https://phabricator.haskell.org/D3633
compiler/deSugar/DsForeign.hs
testsuite/tests/determinism/T13807/A.hs [new file with mode: 0644]
testsuite/tests/determinism/T13807/Makefile [new file with mode: 0644]
testsuite/tests/determinism/T13807/T13807.stdout [new file with mode: 0644]
testsuite/tests/determinism/T13807/all.T [new file with mode: 0644]