-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TEST: Add test for inner struct pass to func
- Loading branch information
1 parent
d0de202
commit 336fa63
Showing
2 changed files
with
25 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from lpython import packed, dataclass, ccallable, i32, ccallback | ||
|
||
@ccallable | ||
@packed | ||
@dataclass | ||
class struct_0: | ||
val_0 : i32 = 613 | ||
|
||
@ccallable | ||
@packed | ||
@dataclass | ||
class struct_1: | ||
val_1 : struct_0 = struct_0() | ||
|
||
def print_val_0_in_struct_0(struct_0_instance : struct_0) -> i32: | ||
print(struct_0_instance.val_0) | ||
return 0 | ||
|
||
@ccallback | ||
def entry_point() -> i32: | ||
struct_1_instance : struct_1 = struct_1() | ||
return print_val_0_in_struct_0(struct_1_instance.val_1) | ||
|
||
assert entry_point() == 0 |