Add RefC math library linking

This commit is contained in:
Robert Wright 2021-05-17 13:18:00 +01:00 committed by G. Allais
parent c34c6e0959
commit 204b96fe6c
5 changed files with 39 additions and 2 deletions

View File

@ -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

View File

@ -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

View 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

View 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
View 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