From e8adffb528f65749b5648c44ab711ef9aec4c69a Mon Sep 17 00:00:00 2001
From: Ben Gamari <ben@smart-cactus.org>
Date: Thu, 4 Jul 2019 11:17:04 -0400
Subject: [PATCH] testsuite: Set -dinitial-unique when reversing uniques

Otherwise the unique counter starts at 0, causing us to immediately
underflow.
---
 testsuite/tests/deriving/should_compile/Makefile   | 2 +-
 testsuite/tests/indexed-types/should_compile/all.T | 2 +-
 testsuite/tests/polykinds/all.T                    | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/testsuite/tests/deriving/should_compile/Makefile b/testsuite/tests/deriving/should_compile/Makefile
index 581aabbce095..f723b5c01df7 100644
--- a/testsuite/tests/deriving/should_compile/Makefile
+++ b/testsuite/tests/deriving/should_compile/Makefile
@@ -6,7 +6,7 @@ include $(TOP)/mk/test.mk
 
 T11148:
 	$(RM) T11148.hi T11148.o
-	'$(TEST_HC)' $(TEST_HC_OPTS) -c -dunique-increment=-1 T11148.hs
+	'$(TEST_HC)' $(TEST_HC_OPTS) -c -dunique-increment=-1 -dinitial-unique=16777215 T11148.hs
 	# Set the unique-increment to '-1' to trigger the bug
 	# This has to be done on the command line;
 	#  an OPTIONS_GHC pragma does not do it
diff --git a/testsuite/tests/indexed-types/should_compile/all.T b/testsuite/tests/indexed-types/should_compile/all.T
index 4a15bdf4f4e1..f4ecabd83df1 100644
--- a/testsuite/tests/indexed-types/should_compile/all.T
+++ b/testsuite/tests/indexed-types/should_compile/all.T
@@ -245,7 +245,7 @@ test('T10318', normal, compile, [''])
 test('UnusedTyVarWarnings', normal, compile, ['-Wunused-type-patterns'])
 test('UnusedTyVarWarningsNamedWCs', normal, compile, ['-Wunused-type-patterns'])
 test('T11408', normal, compile, [''])
-test('T11361', normal, compile, ['-dunique-increment=-1'])
+test('T11361', normal, compile, ['-dunique-increment=-1 -dinitial-unique=16777215'])
   # -dunique-increment=-1 doesn't work inside the file
 test('T11361a', normal, compile_fail, [''])
 test('T11581', normal, compile, [''])
diff --git a/testsuite/tests/polykinds/all.T b/testsuite/tests/polykinds/all.T
index 6238fbe770a0..6345b228e4e0 100644
--- a/testsuite/tests/polykinds/all.T
+++ b/testsuite/tests/polykinds/all.T
@@ -137,7 +137,7 @@ test('T11480b', normal, compile, [''])
 test('T11523', normal, compile, [''])
 test('T11520', normal, compile_fail, [''])
 test('T11516', normal, compile_fail, [''])
-test('T11362', normal, compile, ['-dunique-increment=-1'])
+test('T11362', normal, compile, ['-dunique-increment=-1 -dinitial-unique=16777215'])
   # -dunique-increment=-1 doesn't work inside the file
 test('T11399', normal, compile_fail, [''])
 test('T11611', normal, compile_fail, [''])
-- 
GitLab