mirror of
https://github.com/KevinMidboe/linguist.git
synced 2026-01-25 10:45:30 +00:00
samples: add Terra samples
source: https://github.com/zdevito/terra/tree/master/tests
This commit is contained in:
17
samples/Terra/clean.t
Normal file
17
samples/Terra/clean.t
Normal file
@@ -0,0 +1,17 @@
|
||||
local c = terralib.includec("stdio.h")
|
||||
|
||||
iamclean = macro(function(arg)
|
||||
return quote
|
||||
var a = 3
|
||||
return a,arg
|
||||
end
|
||||
end)
|
||||
|
||||
terra doit()
|
||||
var a = 4
|
||||
iamclean(a)
|
||||
end
|
||||
|
||||
local a = doit()
|
||||
local test = require("test")
|
||||
test.meq({3,4}, a)
|
||||
Reference in New Issue
Block a user