Skip to content

Commit

Permalink
Updated for equation scodeinst tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
perost authored and OpenModelica-Hudson committed Mar 14, 2017
1 parent 1e13743 commit 45dd27c
Show file tree
Hide file tree
Showing 7 changed files with 99 additions and 58 deletions.
30 changes: 30 additions & 0 deletions flattening/modelica/scodeinst/ForEquation1.mo
@@ -0,0 +1,30 @@
// name: ForEquation1.mo
// keywords:
// status: correct
// cflags: -d=newInst
//
//

model ForEquation1
Real x[5];
equation
for i in 1:5 loop
x[i] = i;
end for;
end ForEquation1;

// Result:
// class ForEquation1
// Real x[1];
// Real x[2];
// Real x[3];
// Real x[4];
// Real x[5];
// equation
// x[1] = 1;
// x[2] = 2;
// x[3] = 3;
// x[4] = 4;
// x[5] = 5;
// end ForEquation1;
// endResult
36 changes: 36 additions & 0 deletions flattening/modelica/scodeinst/ForEquation2.mo
@@ -0,0 +1,36 @@
// name: ForEquation2.mo
// keywords:
// status: correct
// cflags: -d=newInst
//

model ForEquation2
Real x[3,3];
equation
for i in 1:2 loop
for i in 1:3 loop
x[i, i] = i;
end for;
end for;
end ForEquation2;

// Result:
// class ForEquation2
// Real x[1,1];
// Real x[1,2];
// Real x[1,3];
// Real x[2,1];
// Real x[2,2];
// Real x[2,3];
// Real x[3,1];
// Real x[3,2];
// Real x[3,3];
// equation
// x[1,1] = 1;
// x[2,2] = 2;
// x[3,3] = 3;
// x[1,1] = 1;
// x[2,2] = 2;
// x[3,3] = 3;
// end ForEquation2;
// endResult
30 changes: 30 additions & 0 deletions flattening/modelica/scodeinst/ForEquation3.mo
@@ -0,0 +1,30 @@
// name: ForEquation3.mo
// keywords:
// status: correct
// cflags: -d=newInst
//
//

model ForEquation3
Real x[5];
equation
for i in {1, 2, 3, 4, 5} loop
x[i] = i;
end for;
end ForEquation3;

// Result:
// class ForEquation3
// Real x[1];
// Real x[2];
// Real x[3];
// Real x[4];
// Real x[5];
// equation
// x[1] = 1;
// x[2] = 2;
// x[3] = 3;
// x[4] = 4;
// x[5] = 5;
// end ForEquation3;
// endResult
6 changes: 3 additions & 3 deletions flattening/modelica/scodeinst/Makefile
Expand Up @@ -46,6 +46,9 @@ eq7.mo \
eq10.mo \
extends3.mo \
ExtendSections.mo \
ForEquation1.mo \
ForEquation2.mo \
ForEquation3.mo \
ForEquationNonParam.mo \
ForStatement1.mo \
ForStatement2.mo \
Expand Down Expand Up @@ -279,9 +282,6 @@ expconn5.mo \
expconn6.mo \
extends1.mo \
extends2.mo \
for1.mo \
for2.mo \
for3.mo \
function1.mo \
FunctionRecordArg1.mo \
ImportUnqualified2.mo \
Expand Down
15 changes: 0 additions & 15 deletions flattening/modelica/scodeinst/for1.mo

This file was deleted.

17 changes: 0 additions & 17 deletions flattening/modelica/scodeinst/for2.mo

This file was deleted.

23 changes: 0 additions & 23 deletions flattening/modelica/scodeinst/for3.mo

This file was deleted.

0 comments on commit 45dd27c

Please sign in to comment.