mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-11-24 06:52:19 +03:00
Add RefC math library linking
This commit is contained in:
parent
c34c6e0959
commit
204b96fe6c
@ -61,7 +61,8 @@ compileCFile {asShared} objectFile outFile =
|
||||
fullprefix_dir dirs "lib" </> "libidris2_support.a" ++ " " ++
|
||||
"-lidris2_refc " ++
|
||||
"-L" ++ fullprefix_dir dirs "refc " ++
|
||||
clibdirs (lib_dirs dirs)
|
||||
clibdirs (lib_dirs dirs) ++
|
||||
"-lm"
|
||||
|
||||
log "compiler.refc.cc" 10 runcc
|
||||
0 <- coreLift $ system runcc
|
||||
|
@ -223,7 +223,7 @@ chezTests = MkTestPool "Chez backend" [Chez]
|
||||
refcTests : TestPool
|
||||
refcTests = MkTestPool "Reference counting C backend" [C]
|
||||
[ "refc001" , "refc002"
|
||||
, "strings"
|
||||
, "strings", "doubles"
|
||||
]
|
||||
|
||||
racketTests : TestPool
|
||||
|
21
tests/refc/doubles/TestDoubles.idr
Normal file
21
tests/refc/doubles/TestDoubles.idr
Normal file
@ -0,0 +1,21 @@
|
||||
module TestDoubles
|
||||
|
||||
put : Double -> IO ()
|
||||
put = putStrLn . show
|
||||
|
||||
main : IO ()
|
||||
main = do
|
||||
put $ exp 1
|
||||
put $ log 1
|
||||
|
||||
put $ sin 1
|
||||
put $ cos 1
|
||||
put $ tan 1
|
||||
put $ asin 1
|
||||
put $ acos 1
|
||||
put $ atan 1
|
||||
|
||||
put $ sqrt 2
|
||||
|
||||
put $ floor 1.5
|
||||
put $ ceiling 1.5
|
11
tests/refc/doubles/expected
Normal file
11
tests/refc/doubles/expected
Normal file
@ -0,0 +1,11 @@
|
||||
2.718282
|
||||
0.000000
|
||||
0.841471
|
||||
0.540302
|
||||
1.557408
|
||||
1.570796
|
||||
0.000000
|
||||
0.785398
|
||||
1.414214
|
||||
1.000000
|
||||
2.000000
|
4
tests/refc/doubles/run
Normal file
4
tests/refc/doubles/run
Normal file
@ -0,0 +1,4 @@
|
||||
$1 --no-banner --no-color --console-width 0 --cg refc -o refc_doubles TestDoubles.idr > /dev/null
|
||||
./build/exec/refc_doubles
|
||||
|
||||
rm -rf build
|
Loading…
Reference in New Issue
Block a user