mirror of
https://github.com/KevinMidboe/linguist.git
synced 2026-01-23 01:35:33 +00:00
samples: add Terra samples
source: https://github.com/zdevito/terra/tree/master/tests
This commit is contained in:
18
samples/Terra/pt.t
Normal file
18
samples/Terra/pt.t
Normal file
@@ -0,0 +1,18 @@
|
||||
|
||||
|
||||
local a = global(double)
|
||||
|
||||
terra getptr()
|
||||
return &a
|
||||
end
|
||||
|
||||
local b = getptr()
|
||||
local c = terralib.pointertolightuserdata(b)
|
||||
print(b,c,a)
|
||||
|
||||
terra foo(a : &&int)
|
||||
|
||||
end
|
||||
|
||||
foo(c)
|
||||
print("DONE")
|
||||
Reference in New Issue
Block a user