[Git][ghc/ghc][master] Add test for #18064
Marge Bot
gitlab at gitlab.haskell.org
Thu Jul 23 00:21:18 UTC 2020
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC
Commits:
ff1b7710 by Sylvain Henry at 2020-07-22T20:21:11-04:00
Add test for #18064
It has been fixed by 0effc57d48ace6b719a9f4cbeac67c95ad55010b
- - - - -
8 changed files:
- testsuite/driver/testglobals.py
- testsuite/driver/testlib.py
- testsuite/mk/ghc-config.hs
- testsuite/mk/test.mk
- + testsuite/tests/ghci/should_run/T18064.script
- + testsuite/tests/ghci/should_run/T18064.stderr
- + testsuite/tests/ghci/should_run/T18064.stdout
- testsuite/tests/ghci/should_run/all.T
Changes:
=====================================
testsuite/driver/testglobals.py
=====================================
@@ -148,6 +148,9 @@ class TestConfig:
# Is the compiler dynamically linked?
self.ghc_dynamic = False
+ # Do symbols use leading underscores?
+ self.leading_underscore = False
+
# the timeout program
self.timeout_prog = ''
self.timeout = 300
=====================================
testsuite/driver/testlib.py
=====================================
@@ -501,6 +501,11 @@ def doing_ghci() -> bool:
def ghc_dynamic() -> bool:
return config.ghc_dynamic
+# Symbols have a leading underscore
+def leading_underscore() -> bool:
+ return config.leading_underscore
+
+
def fast() -> bool:
return config.speed == 2
=====================================
testsuite/mk/ghc-config.hs
=====================================
@@ -23,6 +23,7 @@ main = do
getGhcFieldOrFail fields "GhcUnregisterised" "Unregisterised"
getGhcFieldOrFail fields "GhcWithSMP" "Support SMP"
getGhcFieldOrFail fields "GhcRTSWays" "RTS ways"
+ getGhcFieldOrFail fields "GhcLeadingUnderscore" "Leading underscore"
getGhcFieldOrDefault fields "GhcDynamicByDefault" "Dynamic by default" "NO"
getGhcFieldOrDefault fields "GhcDynamic" "GHC Dynamic" "NO"
getGhcFieldOrDefault fields "GhcProfiled" "GHC Profiled" "NO"
=====================================
testsuite/mk/test.mk
=====================================
@@ -93,6 +93,12 @@ else
RUNTEST_OPTS += -e ghc_with_native_codegen=False
endif
+ifeq "$(GhcLeadingUnderscore)" "YES"
+RUNTEST_OPTS += -e "config.leading_underscore=True"
+else
+RUNTEST_OPTS += -e "config.leading_underscore=False"
+endif
+
GHC_PRIM_LIBDIR := $(subst library-dirs: ,,$(shell "$(GHC_PKG)" field ghc-prim library-dirs --simple-output))
HAVE_VANILLA := $(shell if [ -f $(subst \,/,$(GHC_PRIM_LIBDIR))/GHC/PrimopWrappers.hi ]; then echo YES; else echo NO; fi)
HAVE_DYNAMIC := $(shell if [ -f $(subst \,/,$(GHC_PRIM_LIBDIR))/GHC/PrimopWrappers.dyn_hi ]; then echo YES; else echo NO; fi)
=====================================
testsuite/tests/ghci/should_run/T18064.script
=====================================
@@ -0,0 +1,2 @@
+import GHCi.ObjLink
+lookupClosure "blah"
=====================================
testsuite/tests/ghci/should_run/T18064.stderr
=====================================
@@ -0,0 +1,2 @@
+<interactive>: ^^ Could not load 'blah', dependency unresolved. See top entry above.
+
=====================================
testsuite/tests/ghci/should_run/T18064.stdout
=====================================
@@ -0,0 +1 @@
+Nothing
=====================================
testsuite/tests/ghci/should_run/all.T
=====================================
@@ -66,3 +66,12 @@ test('T16012', just_ghci, ghci_script, ['T16012.script'])
test('T16096', just_ghci, ghci_script, ['T16096.script'])
test('T507', just_ghci, ghci_script, ['T507.script'])
test('T18027', just_ghci, ghci_script, ['T18027.script'])
+test('T18064',
+ [just_ghci,
+ when(leading_underscore(),skip)
+ # we need to skip otherwise the test fails on platforms prepending leading
+ # underscores to symbols (we get "Could not load '_blah'" instead of "Could
+ # not load 'blah').
+ ],
+ ghci_script,
+ ['T18064.script'])
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/ff1b7710c9975a3cc1025cb5b9d29197a5f1a98a
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/ff1b7710c9975a3cc1025cb5b9d29197a5f1a98a
You're receiving this email because of your account on gitlab.haskell.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20200722/f828defa/attachment-0001.html>
More information about the ghc-commits
mailing list