Skip to content

Commit

Permalink
TEST: Add test for inner struct pass to func
Browse files Browse the repository at this point in the history
  • Loading branch information
Shaikh-Ubaid committed Jul 18, 2023
1 parent 96433ad commit f89861b
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions integration_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,7 @@ RUN(NAME structs_30 LABELS cpython llvm c)
RUN(NAME structs_31 LABELS cpython llvm c)
RUN(NAME structs_32 LABELS cpython llvm c)
RUN(NAME structs_33 LABELS cpython llvm c)
RUN(NAME structs_34 LABELS cpython llvm c)

RUN(NAME symbolics_01 LABELS cpython_sym c_sym)
RUN(NAME symbolics_02 LABELS cpython_sym c_sym)
Expand Down
24 changes: 24 additions & 0 deletions integration_tests/structs_34.py
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

0 comments on commit f89861b

Please sign in to comment.