summaryrefslogtreecommitdiff
path: root/testsuite/tests/codeGen/should_run/cgrun035.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/codeGen/should_run/cgrun035.hs')
-rw-r--r--testsuite/tests/codeGen/should_run/cgrun035.hs15
1 files changed, 15 insertions, 0 deletions
diff --git a/testsuite/tests/codeGen/should_run/cgrun035.hs b/testsuite/tests/codeGen/should_run/cgrun035.hs
new file mode 100644
index 0000000000..dfd73cb40a
--- /dev/null
+++ b/testsuite/tests/codeGen/should_run/cgrun035.hs
@@ -0,0 +1,15 @@
+module Main (main) where
+
+import Foreign.C
+import System.IO.Unsafe ( unsafePerformIO )
+
+c :: Double -> Double
+c x = cos x
+ where
+ cos :: Double -> Double
+ cos x = realToFrac (unsafePerformIO (c_cos (realToFrac x)))
+
+foreign import ccall unsafe "cos"
+ c_cos :: CDouble -> IO CDouble
+
+main = putStr (shows (c 0.0) "\n")