Dont refer to `cLeadingUnderscore` in test
authorJohn Ericson <John.Ericson@Obsidian.Systems>
Tue, 7 May 2019 23:09:25 +0000 (19:09 -0400)
committerBen Gamari <ben@smart-cactus.org>
Tue, 14 May 2019 20:41:19 +0000 (16:41 -0400)
Can't use this config entry because it's about to go away

testsuite/tests/th/T16180.hs
testsuite/tests/th/all.T

index 073ad7a..99b1a3b 100644 (file)
@@ -1,21 +1,27 @@
+{-# LANGUAGE CPP #-}
 {-# LANGUAGE TemplateHaskell #-}
 
 module Main where
 
 import Language.Haskell.TH.Syntax
 import Foreign.C.String
-import Config -- from "ghc" package
 
 $(do
-   -- some targets (e.g. Darwin) require a "_" symbol prefix...
-   addForeignSource LangAsm (if cLeadingUnderscore == "YES"
-      then ".global \"_mydata\"\n\
-           \_mydata:\n\
-           \.ascii \"Hello world\\0\"\n"
-      else ".global \"mydata\"\n\
-           \mydata:\n\
-           \.ascii \"Hello world\\0\"\n"
-      )
+   -- some targets (e.g. Darwin) require a "_" symbol prefix. Ideally we
+   -- could reuse FP_LEADING_UNDERSCORE from aclocal.m4 for this
+   -- somehow, but this hopefully is OK for now.
+   addForeignSource LangAsm $ unlines
+#if defined(darwin_HOST_OS) || (defined(mingw32_HOST_OS) && WORD_SIZE_IN_BITS == 32)
+      [ ".global \"_mydata\""
+      , "_mydata:"
+      , ".ascii \"Hello world\\0\""
+      ]
+#else
+      [ ".global \"mydata\""
+      , "mydata:"
+      , ".ascii \"Hello world\\0\""
+      ]
+#endif
    return [])
 
 foreign import ccall "&mydata" mystring :: CString
index c9f2065..f973861 100644 (file)
@@ -13,7 +13,7 @@ if config.have_ext_interp :
        setTestOpts(extra_ways(['ext-interp']))
        setTestOpts(only_ways(['normal','ghci','ext-interp']))
 
-broken_tests = ["ClosedFam1TH","T10620","T10828","T11721_TH","T11797","T12045TH2","T12478_1","T12646","T13642","T14060","T15502","T15738","T15792","T15845","T16180","T1835","T3920","T4135","T4188","T5037","T5362","T7477","T7910","T8761","T8884","T8953","T9262","T9692","T9738","TH_Lift","TH_RichKinds","TH_RichKinds2","TH_Roles3","TH_TyInstWhere2","TH_implicitParams","TH_recursiveDo","TH_reifyDecl1","TH_reifyExplicitForAllFams","TH_reifyInstances","TH_reifyMkName","TH_repE2","TH_repGuard","TH_repPrim","TH_repPrim2","TH_repUnboxedTuples","TH_spliceE6","T16326_TH"]
+broken_tests = ["ClosedFam1TH","T10620","T10828","T11721_TH","T11797","T12045TH2","T12478_1","T12646","T13642","T14060","T15502","T15738","T15792","T15845","T1835","T3920","T4135","T4188","T5037","T5362","T7477","T7910","T8761","T8884","T8953","T9262","T9692","T9738","TH_Lift","TH_RichKinds","TH_RichKinds2","TH_Roles3","TH_TyInstWhere2","TH_implicitParams","TH_recursiveDo","TH_reifyDecl1","TH_reifyExplicitForAllFams","TH_reifyInstances","TH_reifyMkName","TH_repE2","TH_repGuard","TH_repPrim","TH_repPrim2","TH_repUnboxedTuples","TH_spliceE6","T16326_TH"]
 # ext-interp, integer-gmp and llvm is broken see #16087
 def broken_ext_interp(name, opts):
        if name in broken_tests and config.ghc_built_by_llvm:
@@ -467,7 +467,7 @@ test('T15437', expect_broken(15437), multimod_compile,
 test('T15985', normal, compile, [''])
 test('T16133', normal, compile_fail, [''])
 test('T15471', normal, multimod_compile, ['T15471.hs', '-v0'])
-test('T16180', normal, compile_and_run, ['-package ghc'])
+test('T16180', normal, compile_and_run, [''])
 test('T16183', normal, compile, ['-v0 -ddump-splices -dsuppress-uniques'])
 test('T16195', normal, multimod_compile, ['T16195.hs', '-v0'])
 test('T16293b', normal, compile, [''])