Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[NF] Add if-equation branch selection tests.
Belonging to [master]: - OpenModelica/OMCompiler#2729 - OpenModelica/OpenModelica-testsuite#1054
- Loading branch information
1 parent
4654c86
commit 54b3544
Showing
4 changed files
with
80 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// name: IfEquationEval1 | ||
// keywords: | ||
// status: correct | ||
// cflags: -d=newInst | ||
// | ||
|
||
model IfEquationEval1 | ||
Real x; | ||
equation | ||
if true then | ||
x = 1; | ||
else | ||
x = 2; | ||
end if; | ||
end IfEquationEval1; | ||
|
||
// Result: | ||
// class IfEquationEval1 | ||
// Real x; | ||
// equation | ||
// x = 1.0; | ||
// end IfEquationEval1; | ||
// endResult |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// name: IfEquationEval2 | ||
// keywords: | ||
// status: correct | ||
// cflags: -d=newInst | ||
// | ||
|
||
model IfEquationEval2 | ||
Real x; | ||
equation | ||
if false then | ||
x = 0; | ||
elseif true then | ||
x = 1; | ||
else | ||
x = 2; | ||
end if; | ||
end IfEquationEval2; | ||
|
||
// Result: | ||
// class IfEquationEval2 | ||
// Real x; | ||
// equation | ||
// x = 1.0; | ||
// end IfEquationEval2; | ||
// endResult |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// name: IfEquationEval3 | ||
// keywords: | ||
// status: correct | ||
// cflags: -d=newInst | ||
// | ||
|
||
model IfEquationEval3 | ||
Real x; | ||
equation | ||
if time < 1 then | ||
x = 0; | ||
elseif true then | ||
x = 1; | ||
else | ||
x = 2; | ||
end if; | ||
end IfEquationEval3; | ||
|
||
// Result: | ||
// class IfEquationEval3 | ||
// Real x; | ||
// equation | ||
// if time < 1.0 then | ||
// x = 0.0; | ||
// else | ||
// x = 1.0; | ||
// end if; | ||
// end IfEquationEval3; | ||
// endResult |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters