mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 09:40:21 +00:00
13 lines
207 B
Perl
13 lines
207 B
Perl
|
|
|
|
terra add(a : int, b : int)
|
|
return a + b
|
|
end
|
|
|
|
|
|
terralib.saveobj("add.bc",{ add = add })
|
|
|
|
local addlib = terralib.linkllvm("add.bc")
|
|
add2 = addlib:extern("add", {int,int} -> int)
|
|
|
|
assert(add2(3,4) == 7) |