Skip to content

Commit

Permalink
[NF] Add more record evaluation tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
perost authored and OpenModelica-Hudson committed May 21, 2018
1 parent 2a436dd commit 0559144
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 0 deletions.
25 changes: 25 additions & 0 deletions flattening/modelica/scodeinst/CevalRecord5.mo
@@ -0,0 +1,25 @@
// name: CevalRecord5
// keywords:
// status: correct
// cflags: -d=newInst
//

record R
Real x = 1.0;
Real y = 2.0;
Real z = 3.0;
end R;

model CevalRecord5
constant R r1 = R(4.0, 5.0, 6.0);
Real x = r1.x;
end CevalRecord5;

// Result:
// class CevalRecord5
// constant Real r1.x = 4.0;
// constant Real r1.y = 5.0;
// constant Real r1.z = 6.0;
// Real x = 4.0;
// end CevalRecord5;
// endResult
27 changes: 27 additions & 0 deletions flattening/modelica/scodeinst/CevalRecord6.mo
@@ -0,0 +1,27 @@
// name: CevalRecord6
// keywords:
// status: correct
// cflags: -d=newInst
//

record R
Real x = 1.0;
Real y;
Real z = 3.0;
end R;

model CevalRecord6
constant R r1;
Real x = r1.x;
Real z = r1.z;
end CevalRecord6;

// Result:
// class CevalRecord6
// constant Real r1.x = 1.0;
// constant Real r1.y;
// constant Real r1.z = 3.0;
// Real x = 1.0;
// Real z = 3.0;
// end CevalRecord6;
// endResult
2 changes: 2 additions & 0 deletions flattening/modelica/scodeinst/Makefile
Expand Up @@ -110,6 +110,8 @@ CevalRecord1.mo \
CevalRecord2.mo \
CevalRecord3.mo \
CevalRecord4.mo \
CevalRecord5.mo \
CevalRecord6.mo \
CevalReduction1.mo \
CevalReduction2.mo \
CevalRelation1.mo \
Expand Down

0 comments on commit 0559144

Please sign in to comment.