mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 09:40:21 +00:00
16 lines
466 B
Perl
16 lines
466 B
Perl
C = terralib.includec("stdio.h")
|
|
terra main()
|
|
C.printf("hello world\n")
|
|
end
|
|
local m = { main = main }
|
|
terralib.saveobj("output.o",m)
|
|
local a = terralib.saveobj(nil,"object",m)
|
|
terralib.saveobj("output2.bc",m)
|
|
local b = terralib.saveobj(nil,"bitcode",m)
|
|
terralib.saveobj("output.ll",m)
|
|
local c = terralib.saveobj(nil,"llvmir",m)
|
|
terralib.saveobj("output",m)
|
|
terralib.saveobj("output2","executable",m)
|
|
|
|
assert(a:match("hello world"))
|
|
assert(c:match("hello world")) |