Skip to content

Commit

Permalink
[NF] Add record binding test.
Browse files Browse the repository at this point in the history
  • Loading branch information
perost authored and OpenModelica-Hudson committed Oct 10, 2018
1 parent 1d6f8f5 commit b11ba59
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
1 change: 1 addition & 0 deletions flattening/modelica/scodeinst/Makefile
Expand Up @@ -639,6 +639,7 @@ RangeTypeError3.mo \
RealRangeBinding1.mo \
RecordBinding1.mo \
RecordBinding2.mo \
RecordBinding3.mo \
RecursiveExtends1.mo \
RecursiveExtends3.mo \
RedeclareClass1.mo \
Expand Down
33 changes: 33 additions & 0 deletions flattening/modelica/scodeinst/RecordBinding3.mo
@@ -0,0 +1,33 @@
// name: RecordBinding3
// keywords:
// status: correct
// cflags: -d=newInst
//

record R
Real x[:] = {1, 2, 3};
Real y[:];
Real z[size(y, 1)];
end R;

model RecordBinding3
R r = R(ones(5), {1, 2}, {3, 4});
end RecordBinding3;

// Result:
// class RecordBinding3
// Real r.x[1];
// Real r.x[2];
// Real r.x[3];
// Real r.x[4];
// Real r.x[5];
// Real r.y[1];
// Real r.y[2];
// Real r.z[1];
// Real r.z[2];
// equation
// r.x = {1.0, 1.0, 1.0, 1.0, 1.0};
// r.y = {1.0, 2.0};
// r.z = {3.0, 4.0};
// end RecordBinding3;
// endResult

0 comments on commit b11ba59

Please sign in to comment.