[commit: ghc] wip/fix-T16180-on-darwin: testsuite: Fix T16180 on Darwin (f7dd846)

git at git.haskell.org git at git.haskell.org
Wed Jan 23 00:09:32 UTC 2019


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/fix-T16180-on-darwin
Link       : http://ghc.haskell.org/trac/ghc/changeset/f7dd8463f8b853524f8b32f1fae2df102979d382/ghc

>---------------------------------------------------------------

commit f7dd8463f8b853524f8b32f1fae2df102979d382
Author: Ben Gamari <ben at smart-cactus.org>
Date:   Tue Jan 22 19:05:45 2019 -0500

    testsuite: Fix T16180 on Darwin
    
    As mentioned in #16218, the CPP macro likely isn't defined when we run the
    assembler.


>---------------------------------------------------------------

f7dd8463f8b853524f8b32f1fae2df102979d382
 testsuite/tests/th/T16180.hs | 7 ++++---
 testsuite/tests/th/all.T     | 2 +-
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/testsuite/tests/th/T16180.hs b/testsuite/tests/th/T16180.hs
index 2a4b80c..5c99f16 100644
--- a/testsuite/tests/th/T16180.hs
+++ b/testsuite/tests/th/T16180.hs
@@ -1,4 +1,5 @@
 {-# LANGUAGE TemplateHaskell #-}
+{-# LANGUAGE CPP #-}
 
 module Main where
 
@@ -9,13 +10,13 @@ $(do
    -- some architectures require a "_" symbol prefix...
    -- GHC defines a LEADING_UNDERSCORE CPP constant to indicate this.
    addForeignSource LangAsm
-      "#if defined(LEADING_UNDERSCORE)\n\
+#if LEADING_UNDERSCORE
       \.global \"_mydata\"\n\
       \_mydata:\n\
-      \#else\n\
+#else
       \.global \"mydata\"\n\
       \mydata:\n\
-      \#endif\n\
+#endif
       \.ascii \"Hello world\\0\"\n"
    return [])
 
diff --git a/testsuite/tests/th/all.T b/testsuite/tests/th/all.T
index 4062cf2..9ddf283 100644
--- a/testsuite/tests/th/all.T
+++ b/testsuite/tests/th/all.T
@@ -467,4 +467,4 @@ 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', when(opsys('darwin'), expect_broken(16218)), compile_and_run, [''])
+test('T16180', normal, compile_and_run, [''])



More information about the ghc-commits mailing list