Skip to content

Commit

Permalink
[NF] Add if-equation test.
Browse files Browse the repository at this point in the history
  • Loading branch information
perost authored and OpenModelica-Hudson committed Jun 21, 2018
1 parent fb83712 commit d023d7a
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
29 changes: 29 additions & 0 deletions flattening/modelica/scodeinst/IfEquation5.mo
@@ -0,0 +1,29 @@
// name: IfEquation5
// keywords:
// status: correct
// cflags: -d=newInst
//

model IfEquation5
Real x[2];
parameter Boolean p[2] = {false, true};
equation
x[1] = 1;
for i in 1:2 loop
if p[i] then
x[i] = 2;
end if;
end for;
end IfEquation5;

// Result:
// class IfEquation5
// Real x[1];
// Real x[2];
// parameter Boolean p[1] = false;
// parameter Boolean p[2] = true;
// equation
// x[1] = 1.0;
// x[2] = 2.0;
// end IfEquation5;
// endResult
1 change: 1 addition & 0 deletions flattening/modelica/scodeinst/Makefile
Expand Up @@ -467,6 +467,7 @@ IfEquation1.mo \
IfEquation2.mo \
IfEquation3.mo \
IfEquation4.mo \
IfEquation5.mo \
IfExpression1.mo \
IfExpression2.mo \
IfExpression3.mo \
Expand Down

0 comments on commit d023d7a

Please sign in to comment.