forked from lcompilers/lpython
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Respect --disable-main in global_stmts pass
- Loading branch information
Showing
7 changed files
with
90 additions
and
11 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
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,13 @@ | ||
{ | ||
"basename": "c-import_order_01-3ebf3c3", | ||
"cmd": "lpython --no-color --disable-main --show-c {infile}", | ||
"infile": "tests/../integration_tests/import_order_01.py", | ||
"infile_hash": "b6f67090973a5fce0778dbdd86fdb12272a8da5bbae2f50051df34e5", | ||
"outfile": null, | ||
"outfile_hash": null, | ||
"stdout": "c-import_order_01-3ebf3c3.stdout", | ||
"stdout_hash": "d844d0d693ba8a9867f29b17de6f66c99f2096b7a14efeb4c5d698d2", | ||
"stderr": null, | ||
"stderr_hash": null, | ||
"returncode": 0 | ||
} |
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,52 @@ | ||
#include <inttypes.h> | ||
|
||
#include <stdlib.h> | ||
#include <stdbool.h> | ||
#include <stdio.h> | ||
#include <string.h> | ||
#include <lfortran_intrinsics.h> | ||
|
||
#define ASSERT(cond) \ | ||
{ \ | ||
if (!(cond)) { \ | ||
printf("%s%s", "ASSERT failed: ", __FILE__); \ | ||
printf("%s%s", "\nfunction ", __func__); \ | ||
printf("%s%d%s", "(), line number ", __LINE__, " at \n"); \ | ||
printf("%s%s", #cond, "\n"); \ | ||
exit(1); \ | ||
} \ | ||
} | ||
#define ASSERT_MSG(cond, msg) \ | ||
{ \ | ||
if (!(cond)) { \ | ||
printf("%s%s", "ASSERT failed: ", __FILE__); \ | ||
printf("%s%s", "\nfunction ", __func__); \ | ||
printf("%s%d%s", "(), line number ", __LINE__, " at \n"); \ | ||
printf("%s%s", #cond, "\n"); \ | ||
printf("%s", "ERROR MESSAGE:\n"); \ | ||
printf("%s%s", msg, "\n"); \ | ||
exit(1); \ | ||
} \ | ||
} | ||
|
||
|
||
struct dimension_descriptor | ||
{ | ||
int32_t lower_bound, length; | ||
}; | ||
|
||
// Implementations | ||
int32_t f() | ||
{ | ||
int32_t _lpython_return_variable; | ||
_lpython_return_variable = 42; | ||
return _lpython_return_variable; | ||
} | ||
|
||
void main1() | ||
{ | ||
int32_t a; | ||
a = f(); | ||
printf("%d\n", a); | ||
} | ||
|
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