diff options
author | Ben Gamari <bgamari.foss@gmail.com> | 2017-04-23 10:04:03 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2017-04-23 11:05:48 -0400 |
commit | 907b0f3da6f8fafaa39caba92a5611040f5de786 (patch) | |
tree | 62ebbcba9e0f005c0db8c60631258157c3f1680b /testsuite | |
parent | f6eaf01c14960f9d600d5e4c743efc59c37bd4e3 (diff) | |
download | haskell-907b0f3da6f8fafaa39caba92a5611040f5de786.tar.gz |
testsuite: Add testcase for #13587
Test Plan: Validate
Reviewers: austin
Subscribers: rwbarton, thomie
GHC Trac Issues: #13587
Differential Revision: https://phabricator.haskell.org/D3474
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/tests/th/T13587.hs | 12 | ||||
-rw-r--r-- | testsuite/tests/th/T13587A.hs | 14 | ||||
-rw-r--r-- | testsuite/tests/th/all.T | 1 |
3 files changed, 27 insertions, 0 deletions
diff --git a/testsuite/tests/th/T13587.hs b/testsuite/tests/th/T13587.hs new file mode 100644 index 0000000000..2986fd224b --- /dev/null +++ b/testsuite/tests/th/T13587.hs @@ -0,0 +1,12 @@ +{-# LANGUAGE TemplateHaskell #-} + +import T13587A + +main :: IO () +main = do + let sin' = $$(importDoubleToDouble "sin") + cos' = $$(importDoubleToDouble "cos") + -- + print (sin' 0) + print (cos' pi) + diff --git a/testsuite/tests/th/T13587A.hs b/testsuite/tests/th/T13587A.hs new file mode 100644 index 0000000000..b144cc2bc6 --- /dev/null +++ b/testsuite/tests/th/T13587A.hs @@ -0,0 +1,14 @@ +{-# LANGUAGE TemplateHaskell #-} +{-# LANGUAGE QuasiQuotes #-} + +module T13587A where + +import Language.Haskell.TH +import Language.Haskell.TH.Syntax + +importDoubleToDouble :: String -> Q (TExp (Double -> Double)) +importDoubleToDouble fname = do + n <- newName fname + d <- forImpD CCall unsafe fname n [t|Double -> Double|] + addTopDecls [d] + unsafeTExpCoerce (varE n) diff --git a/testsuite/tests/th/all.T b/testsuite/tests/th/all.T index e4d4731f9a..7c98d13fa7 100644 --- a/testsuite/tests/th/all.T +++ b/testsuite/tests/th/all.T @@ -381,3 +381,4 @@ test('T13123', normal, compile, ['-v0']) test('T13098', normal, compile, ['-v0']) test('T11046', normal, multimod_compile, ['T11046','-v0']) test('T13366', normal, compile_and_run, ['-lstdc++ -v0']) +test('T13587', expect_broken(13587), compile_and_run, ['-v0']) |