Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Add flag `-d=printRecordTypes` to print out record types instead of record constructor functions in the flat code.
- Loading branch information
Showing
7 changed files
with
114 additions
and
19 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
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
52 changes: 52 additions & 0 deletions
52
testsuite/flattening/modelica/scodeinst/PrintRecordTypes1.mo
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 @@ | ||
// name: PrintRecordTypes1 | ||
// keywords: | ||
// status: correct | ||
// cflags: -d=newInst,-nfScalarize,printRecordTypes | ||
// | ||
|
||
record R1 | ||
Real x; | ||
Real y; | ||
end R1; | ||
|
||
record R2 | ||
R1 ra; | ||
R1 rb; | ||
end R2; | ||
|
||
model B | ||
R2 c[10]; | ||
end B; | ||
|
||
model PrintRecordTypes1 | ||
B[100] b; | ||
equation | ||
for i in 1:100 loop | ||
b[i].c[10] = R2(R1(1, 0), R1(i,1)); | ||
b[i].c[1].rb = R1(i,0); | ||
end for; | ||
end PrintRecordTypes1; | ||
|
||
// Result: | ||
// record R1 | ||
// input Real x; | ||
// input Real y; | ||
// end R1; | ||
// | ||
// record R2 | ||
// input R1 ra; | ||
// input R1 rb; | ||
// end R2; | ||
// | ||
// class PrintRecordTypes1 | ||
// Real[100, 10] b.c.ra.x; | ||
// Real[100, 10] b.c.ra.y; | ||
// Real[100, 10] b.c.rb.x; | ||
// Real[100, 10] b.c.rb.y; | ||
// equation | ||
// for i in 1:100 loop | ||
// b[i].c[1].rb = R1(/*Real*/(i), 0.0); | ||
// b[i].c[10] = R2(R1(1.0, 0.0), R1(/*Real*/(i), 1.0)); | ||
// end for; | ||
// end PrintRecordTypes1; | ||
// endResult |