Skip to content

Commit

Permalink
[NF] Test if equation with impure condition.
Browse files Browse the repository at this point in the history
Belonging to [master]:
  - #150
  - OpenModelica/OMCompiler#3060
  • Loading branch information
perost authored and OpenModelica-Hudson committed Apr 23, 2019
1 parent 614f67c commit 5e43ef8
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
35 changes: 35 additions & 0 deletions testsuite/flattening/modelica/scodeinst/IfEquationImpure1.mo
@@ -0,0 +1,35 @@
// name: IfEquationImpure1
// keywords:
// status: correct
// cflags: -d=newInst
//

model IfEquationImpure1
Real x = time;
Real y;
parameter Boolean cond = false;
equation
when Clock() then
if sample(cond) then
y = sample(x);
else
y = 0;
end if;
end when;
end IfEquationImpure1;

// Result:
// class IfEquationImpure1
// Real x = time;
// Real y;
// parameter Boolean cond = false;
// equation
// when Clock() then
// if sample(cond, Clock()) then
// y = sample(x, Clock());
// else
// y = 0.0;
// end if;
// end when;
// end IfEquationImpure1;
// endResult
1 change: 1 addition & 0 deletions testsuite/flattening/modelica/scodeinst/Makefile
Expand Up @@ -533,6 +533,7 @@ IfEquation7.mo \
IfEquationEval1.mo \
IfEquationEval2.mo \
IfEquationEval3.mo \
IfEquationImpure1.mo \
IfExpression1.mo \
IfExpression2.mo \
IfExpression3.mo \
Expand Down

0 comments on commit 5e43ef8

Please sign in to comment.