Files
linguist/samples/Terra/simpleglobal.t
2016-01-28 11:22:27 +07:00

19 lines
210 B
Perl

local a = terralib.global(int)
local b = terralib.global(5)
local c = terralib.global(int,3)
terra foo()
a = 4
end
terra bar()
return c + a + b
end
foo()
assert(bar() == 12)
b:set(4)
assert(bar() == 11)