Skip to content

Commit

Permalink
- Added test case for inner/outer enumeration dimensions when using b…
Browse files Browse the repository at this point in the history
…indings.
  • Loading branch information
perost committed May 25, 2015
1 parent 72a94bb commit 1a5bab4
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
30 changes: 30 additions & 0 deletions flattening/modelica/enums/EnumInnerOuterDim.mo
@@ -0,0 +1,30 @@
// name: EnumInnerOuterDim
// keywords: enumeration enum inner outer dimension
// status: correct
//
// Tests that inner outer arrays with enumeration dimensions are handled
// correctly.
//

type E = enumeration (A, B, C);

block Model1
outer parameter Real[E] p1;
parameter Real[E] p2 = p1;
end Model1;

block Model2
inner parameter Real[E] p1;
Model1 m1;
end Model2;

// Result:
// class Model2
// parameter Real p1[E.A];
// parameter Real p1[E.B];
// parameter Real p1[E.C];
// parameter Real m1.p2[E.A] = p1[E.A];
// parameter Real m1.p2[E.B] = p1[E.B];
// parameter Real m1.p2[E.C] = p1[E.C];
// end Model2;
// endResult
1 change: 1 addition & 0 deletions flattening/modelica/enums/Makefile
Expand Up @@ -20,6 +20,7 @@ EnumConnectArray.mo \
EnumDimSum.mo \
EnumFor.mo \
EnumFor2.mo \
EnumInnerOuterDim.mo \
EnumInvalidLiteral.mo \
EnumMatrixProduct.mo \
EnumRange.mo \
Expand Down

0 comments on commit 1a5bab4

Please sign in to comment.