summaryrefslogtreecommitdiff
path: root/testsuite/tests/th/TH_foreignCallingConventions.stderr
diff options
context:
space:
mode:
authorLuite Stegeman <stegeman@gmail.com>2014-11-19 18:38:58 -0600
committerAustin Seipp <austin@well-typed.com>2014-11-19 19:49:42 -0600
commitc6e12e69fa348328d58540a1ea8abed35d0dda32 (patch)
treebbfb1d10d6dc70e339b01370ff08dbfd04d06de9 /testsuite/tests/th/TH_foreignCallingConventions.stderr
parentbc2289e13d9586be087bd8136943dc35a0130c88 (diff)
downloadhaskell-c6e12e69fa348328d58540a1ea8abed35d0dda32.tar.gz
Make calling conventions in template haskell Syntax.hs consistent with those in ghc ForeignCall.hs
this impliments #9703 from ghc trac Test Plan: still needs tests Reviewers: cmsaperstein, ekmett, goldfire, austin Reviewed By: goldfire, austin Subscribers: goldfire, thomie, carter, simonmar Differential Revision: https://phabricator.haskell.org/D353 GHC Trac Issues: #9703
Diffstat (limited to 'testsuite/tests/th/TH_foreignCallingConventions.stderr')
-rw-r--r--testsuite/tests/th/TH_foreignCallingConventions.stderr30
1 files changed, 30 insertions, 0 deletions
diff --git a/testsuite/tests/th/TH_foreignCallingConventions.stderr b/testsuite/tests/th/TH_foreignCallingConventions.stderr
new file mode 100644
index 0000000000..bf1f8b81f5
--- /dev/null
+++ b/testsuite/tests/th/TH_foreignCallingConventions.stderr
@@ -0,0 +1,30 @@
+foreign import ccall interruptible "&" foo :: GHC.Ptr.Ptr ()
+foreign import prim safe "bar" bar :: GHC.Prim.Int# ->
+ GHC.Prim.Int#
+foreign import capi unsafe "baz" baz :: GHC.Types.Double ->
+ GHC.Types.IO ()
+foreign import stdcall safe "bay" bay :: (GHC.Types.Int ->
+ GHC.Types.Bool) ->
+ GHC.Types.IO GHC.Types.Int
+foreign import javascript unsafe "bax" bax :: GHC.Ptr.Ptr GHC.Types.Int ->
+ GHC.Types.IO GHC.Base.String
+TH_foreignCallingConventions.hs:1:1: Splicing declarations
+ do { let fi cconv safety lbl name ty
+ = ForeignD (ImportF cconv safety lbl name ty);
+ dec1 <- fi CCall Interruptible "&" (mkName "foo")
+ <$> [t| Ptr () |];
+ dec2 <- fi Prim Safe "bar" (mkName "bar") <$> [t| Int# -> Int# |];
+ dec3 <- fi CApi Unsafe "baz" (mkName "baz")
+ <$> [t| Double -> IO () |];
+ dec4 <- fi StdCall Safe "bay" (mkName "bay")
+ <$> [t| (Int -> Bool) -> IO Int |];
+ dec5 <- fi JavaScript Unsafe "bax" (mkName "bax")
+ <$> [t| Ptr Int -> IO String |];
+ runIO
+ $ mapM_ (putStrLn . pprint) [dec1, dec2, dec3, dec4, dec5]
+ >> hFlush stdout;
+ return [dec1, dec2] }
+ ======>
+ TH_foreignCallingConventions.hs:(13,4)-(23,25)
+ foreign import ccall interruptible "static &foo" foo :: Ptr ()
+ foreign import prim safe "static bar" bar :: Int# -> Int#