repo.or.cz
/
tcc4lua.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Imported code from luatcc-1.0.0.tar.gz
[tcc4lua.git]
/
test
/
test2.lua
blob
9a52d603ee1ca456ffdb4d1a2683ef99773062fc
1
print
"luatcc working compilation test:"
2
print
"--------------------------------"
3
4
local
luatcc
=
require
'tcc'
5
local
context
=
luatcc
.
new
()
6
7
context
:
compile
(
[[
8
#include <lua.h>
9
int foo(lua_State* L)
10
{
11
lua_pushstring(L, "Hello World!");
12
return 1;
13
}
14
]]
)
15
context
:
relocate
()
16
local
foo
=
context
:
get_symbol
(
"foo"
)
17
print
(
foo
())