-
Notifications
You must be signed in to change notification settings - Fork 205
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix inline functions on windows (#405)
* Add inline function test * Provide a partial fix for the inline problem, but not the stdio-specific problem. * Disable tests again because test environment can't find legacy stdio lib * Fix permissions.
- Loading branch information
1 parent
11ad957
commit 39764e6
Showing
7 changed files
with
52 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
C = terralib.includecstring[[inline int testfunc(int a, int b) { return a + b; }]] | ||
|
||
terra foobar() : int | ||
var a : int = 5 | ||
return C.testfunc(a, 9) | ||
end | ||
assert(foobar() == 14) | ||
|
||
terralib.saveobj("inline_c.exe", {main = foobar}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
C = terralib.includecstring[[ | ||
#include <stdio.h> | ||
inline int testfunc(int a, int b) { return a + b; }]] | ||
|
||
terra foobar() : int | ||
var a : int = 5 | ||
C.printf("C: %i\n", C.testfunc(a, 9)) | ||
return C.testfunc(a, 9) | ||
end | ||
assert(foobar() == 14) | ||
|
||
terralib.saveobj("stdio.exe", {main = foobar}) |