M lib/tukan/tcc.sc +7 -4
@@ 20,10 20,13 @@ do
TCC_INCLUDE_PATH := module-dir .. "/../../include/libtcc/include"
TCC_LIB_PATH := module-dir .. "/../../lib"
- inline tcc_verify (f ...)
- let res = (f ...)
- assert (res == 0)
- res
+ spice tcc_verify (f ...)
+ let msg =
+ .. "\n" (repr ('anchor args)) " tcc call failed"
+ spice-quote
+ let res = (f ...)
+ assert (res == 0) msg
+ res
type TCC :: (mutable @TCCState)
inline __typecall (cls)
M testing/test_tcc.sc +17 -21
@@ 2,21 2,12 @@
using import tukan.tcc
-vvv bind testcode
-""""#include <tcclib.h>
+cc := (TCC)
- void main() {
- printf("Hello, World!\n");
- }
-
-cc := (TCC)
-from (methodsof cc) let set_lib_path add_include_path add_library_path
- \ set_output_type compile_string relocate get_symbol run
-
-set_lib_path TCC_LIB_PATH
+'set_lib_path cc TCC.LIB_PATH
va-map
inline (path)
- add_include_path path
+ 'add_include_path cc path
TCC_INCLUDE_PATH
#"/usr/local/include/x86_64-linux-gnu"
#"/usr/local/include"
@@ 24,7 15,7 @@ va-map
#"/usr/include"
va-map
inline (path)
- add_library_path path
+ 'add_library_path cc path
#"/usr/lib/x86_64-linux-gnu"
#"/usr/lib"
#"/lib/x86_64-linux-gnu"
@@ 32,15 23,20 @@ va-map
#"/usr/local/lib/x86_64-linux-gnu"
#"/usr/local/lib"
-set_output_type TCC.OUTPUT_MEMORY
-tcc_verify compile_string testcode
-#'run cc 0 null
-tcc_verify relocate TCC.RELOCATE_AUTO
+'set_output_type cc TCC.OUTPUT_MEMORY
-func := (get_symbol "main")
-assert (func != null)
-call
- func as (@ (function void))
+#tcc_verify 'compile_string cc testcode
+tcc_verify 'add_file cc
+ report (module-dir .. "/tcc_in.c")
+static-if 1
+ 'run cc 0 null
+else
+ tcc_verify 'relocate cc TCC.RELOCATE_AUTO
+
+ func := ('get_symbol cc "main")
+ assert (func != null)
+ call
+ func as (@ (function void))
;
No newline at end of file
M testing/tukdag.sc +0 -1
@@ 5,7 5,6 @@ using import Map
using import Array
using import glm
-import ..lib.tukan.use
using import tukan.FIR
using import tukan.CADAG.dot
using import tukan.gl