summaryrefslogtreecommitdiff
path: root/testsuite/tests/lib/integer
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2021-01-27 18:03:27 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-01-30 14:13:41 -0500
commita3d995fa18079ac31623febc8f41297c9acfb6a5 (patch)
treefecfdd90fe8e491573ee119d05f17c27c0acc55c /testsuite/tests/lib/integer
parent69cab37ae89db16cfd0b734d7fc657e56402a255 (diff)
downloadhaskell-a3d995fa18079ac31623febc8f41297c9acfb6a5.tar.gz
Fix -dynamic-too with wired-in modules (#19264)
See T19264 for a tricky corner case when explicitly importing GHC.Num.BigNat and another module. With -dynamic-too, the FinderCache contains paths for non-dynamic interfaces so they must be loaded first, which is usually the case, except for some interfaces loaded in the backend (e.g. in CorePrep). So we must run the backend for the non-dynamic way first for -dynamic-too to work as it is but I broke this invariant in c85f4928d4dbb2eb2cf906d08bfe7620d6f04ca5 by mistakenly making the backend run for the dynamic way first.
Diffstat (limited to 'testsuite/tests/lib/integer')
-rw-r--r--testsuite/tests/lib/integer/T19264.hs4
-rw-r--r--testsuite/tests/lib/integer/T19264b.hs1
-rw-r--r--testsuite/tests/lib/integer/all.T3
3 files changed, 8 insertions, 0 deletions
diff --git a/testsuite/tests/lib/integer/T19264.hs b/testsuite/tests/lib/integer/T19264.hs
new file mode 100644
index 0000000000..87390c47fb
--- /dev/null
+++ b/testsuite/tests/lib/integer/T19264.hs
@@ -0,0 +1,4 @@
+module T19264 where
+
+import T19264b -- needed (compiled before this module and triggering the failure)
+import GHC.Num.BigNat (bigNatFromWordList)
diff --git a/testsuite/tests/lib/integer/T19264b.hs b/testsuite/tests/lib/integer/T19264b.hs
new file mode 100644
index 0000000000..3bea6669db
--- /dev/null
+++ b/testsuite/tests/lib/integer/T19264b.hs
@@ -0,0 +1 @@
+module T19264b where
diff --git a/testsuite/tests/lib/integer/all.T b/testsuite/tests/lib/integer/all.T
index c132ca24dd..740fa0e606 100644
--- a/testsuite/tests/lib/integer/all.T
+++ b/testsuite/tests/lib/integer/all.T
@@ -15,6 +15,9 @@ test('bignumMatch', [], compile, [''])
test('T18813', [], compile_and_run, [''])
test('T19170', [], compile_and_run, [''])
+# skipped on Windows (doesn't support `-dynamic-too`)
+test('T19264', [when(opsys('mingw32'),skip),extra_files(['T19264b.hs'])], compile, ['-dynamic-too --make -v0'])
+
# skip ghci as it doesn't support unboxed tuples
test('integerImportExport', [omit_ways(['ghci'])], compile_and_run, [''])