Imported code from luatcc-1.0.0.tar.gz
[tcc4lua.git] / test / test2.lua
blob9a52d603ee1ca456ffdb4d1a2683ef99773062fc
1 print "luatcc working compilation test:"
2 print "--------------------------------"
4 local luatcc = require 'tcc'
5 local context = luatcc.new()
7 context:compile([[
8 #include <lua.h>
9 int foo(lua_State* L)
11 lua_pushstring(L, "Hello World!");
12 return 1;
14 ]])
15 context:relocate()
16 local foo = context:get_symbol("foo")
17 print(foo())