diff options
-rw-r--r-- | compiler/typecheck/TcTypeable.hs | 4 | ||||
-rw-r--r-- | testsuite/driver/testlib.py | 9 | ||||
-rw-r--r-- | testsuite/tests/simplCore/should_compile/Makefile | 3 | ||||
-rw-r--r-- | testsuite/tests/simplCore/should_compile/T8274.stdout | 8 |
4 files changed, 16 insertions, 8 deletions
diff --git a/compiler/typecheck/TcTypeable.hs b/compiler/typecheck/TcTypeable.hs index c951387861..032ff79cbf 100644 --- a/compiler/typecheck/TcTypeable.hs +++ b/compiler/typecheck/TcTypeable.hs @@ -194,9 +194,7 @@ mkTyConRepBinds (dflags, mod_expr, pkg_str, mod_str, tr_datacon, trn_datacon) ty hashThis :: String hashThis = unwords [pkg_str, mod_str, tycon_str] - Fingerprint high low - | gopt Opt_SuppressUniques dflags = Fingerprint 0 0 - | otherwise = fingerprintString hashThis + Fingerprint high low = fingerprintString hashThis word64 :: Word64 -> HsLit word64 | wORD_SIZE dflags == 4 = \n -> HsWord64Prim (show n) (toInteger n) diff --git a/testsuite/driver/testlib.py b/testsuite/driver/testlib.py index c41bb8cb65..4e9a1fbfa4 100644 --- a/testsuite/driver/testlib.py +++ b/testsuite/driver/testlib.py @@ -1691,12 +1691,20 @@ def normalise_callstacks(str): # Ignore line number differences in call stacks (#10834). return re.sub(', called at (.+):[\\d]+:[\\d]+ in [\\w\-\.]+:', repl, str) +def normalise_type_reps(str): + """ Normalise out fingerprints from Typeable TyCon representations """ + return re.sub(r'TyCon\s*\d+\#\#\s*\d+\#\#\s*', + 'TyCon FINGERPRINT FINGERPRINT ', + str, + flags=re.MULTILINE) + def normalise_errmsg( str ): # remove " error:" and lower-case " Warning:" to make patch for # trac issue #10021 smaller str = modify_lines(str, lambda l: re.sub(' error:', '', l)) str = modify_lines(str, lambda l: re.sub(' Warning:', ' warning:', l)) str = normalise_callstacks(str) + str = normalise_type_reps(str) # If somefile ends in ".exe" or ".exe:", zap ".exe" (for Windows) # the colon is there because it appears in error messages; this @@ -1766,6 +1774,7 @@ def normalise_output( str ): # This can occur in error messages generated by the program. str = re.sub('([^\\s])\\.exe', '\\1', str) str = normalise_callstacks(str) + str = normalise_type_reps(str) return str def normalise_asm( str ): diff --git a/testsuite/tests/simplCore/should_compile/Makefile b/testsuite/tests/simplCore/should_compile/Makefile index a804768fa3..87b1d95c3d 100644 --- a/testsuite/tests/simplCore/should_compile/Makefile +++ b/testsuite/tests/simplCore/should_compile/Makefile @@ -14,7 +14,8 @@ T11155: T8274: $(RM) -f T8274.o T8274.hi - '$(TEST_HC)' $(TEST_HC_OPTS) -O -c -ddump-simpl -dsuppress-uniques T8274.hs | grep '#' + # Set -dppr-cols to ensure things don't wrap + '$(TEST_HC)' $(TEST_HC_OPTS) -O -c -ddump-simpl -dsuppress-uniques -dppr-cols=200 T8274.hs | grep '#' T7865: $(RM) -f T7865.o T7865.hi diff --git a/testsuite/tests/simplCore/should_compile/T8274.stdout b/testsuite/tests/simplCore/should_compile/T8274.stdout index 269f4e73f6..05a0069720 100644 --- a/testsuite/tests/simplCore/should_compile/T8274.stdout +++ b/testsuite/tests/simplCore/should_compile/T8274.stdout @@ -1,12 +1,12 @@ T8274.$trModule2 = GHC.Types.TrNameS "main"# T8274.$trModule1 = GHC.Types.TrNameS "T8274"# T8274.$tc'Positives1 = GHC.Types.TrNameS "'Positives"# - GHC.Types.TyCon 0## 0## T8274.$trModule T8274.$tc'Positives1 +T8274.$tc'Positives = GHC.Types.TyCon 14732531009298850569## 4925356269917933860## T8274.$trModule T8274.$tc'Positives1 T8274.$tcP1 = GHC.Types.TrNameS "P"# -T8274.$tcP = GHC.Types.TyCon 0## 0## T8274.$trModule T8274.$tcP1 +T8274.$tcP = GHC.Types.TyCon 11095028091707994303## 9476557054198009608## T8274.$trModule T8274.$tcP1 T8274.$tc'Negatives1 = GHC.Types.TrNameS "'Negatives"# - GHC.Types.TyCon 0## 0## T8274.$trModule T8274.$tc'Negatives1 +T8274.$tc'Negatives = GHC.Types.TyCon 15950179315687996644## 11481167534507418130## T8274.$trModule T8274.$tc'Negatives1 T8274.$tcN1 = GHC.Types.TrNameS "N"# -T8274.$tcN = GHC.Types.TyCon 0## 0## T8274.$trModule T8274.$tcN1 +T8274.$tcN = GHC.Types.TyCon 7479687563082171902## 17616649989360543185## T8274.$trModule T8274.$tcN1 p = T8274.Positives 42# 4.23# 4.23## '4'# 4## n = T8274.Negatives -4# -4.0# -4.0## |