summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--testsuite/tests/th/T16180.hs22
-rw-r--r--testsuite/tests/th/all.T2
2 files changed, 14 insertions, 10 deletions
diff --git a/testsuite/tests/th/T16180.hs b/testsuite/tests/th/T16180.hs
index 2a4b80c976..b6deab6e1c 100644
--- a/testsuite/tests/th/T16180.hs
+++ b/testsuite/tests/th/T16180.hs
@@ -1,4 +1,5 @@
{-# LANGUAGE TemplateHaskell #-}
+{-# LANGUAGE CPP #-}
module Main where
@@ -8,15 +9,18 @@ import Foreign.C.String
$(do
-- some architectures require a "_" symbol prefix...
-- GHC defines a LEADING_UNDERSCORE CPP constant to indicate this.
- addForeignSource LangAsm
- "#if defined(LEADING_UNDERSCORE)\n\
- \.global \"_mydata\"\n\
- \_mydata:\n\
- \#else\n\
- \.global \"mydata\"\n\
- \mydata:\n\
- \#endif\n\
- \.ascii \"Hello world\\0\"\n"
+ let asm = unlines
+ [ "#include \"ghcconfig.h\""
+ , "#if LEADING_UNDERSCORE"
+ , ".global \"_mydata\""
+ , "_mydata:"
+ , "#else"
+ , ".global \"mydata\""
+ , "mydata:"
+ , "#endif"
+ , ".ascii \"Hello world\\0\""
+ ]
+ addForeignSource LangAsm asm
return [])
foreign import ccall "&mydata" mystring :: CString
diff --git a/testsuite/tests/th/all.T b/testsuite/tests/th/all.T
index 4062cf2af0..9ddf28345e 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, [''])