Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Belonging to [master]: - OpenModelica/OMCompiler#2328 - OpenModelica/OpenModelica-testsuite#906
- Loading branch information
1 parent
dddb7ad
commit 21c648d
Showing
5 changed files
with
128 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
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,27 @@ | ||
// name: TupleOperation1 | ||
// keywords: | ||
// status: correct | ||
// cflags: -d=newInst | ||
// | ||
|
||
function f | ||
input Real t; | ||
output Real x = 1.0; | ||
output Real y = 2.0; | ||
end f; | ||
|
||
model TupleOperation1 | ||
Real x = -f(time); | ||
end TupleOperation1; | ||
|
||
// Result: | ||
// function f | ||
// input Real t; | ||
// output Real x = 1.0; | ||
// output Real y = 2.0; | ||
// end f; | ||
// | ||
// class TupleOperation1 | ||
// Real x = -f(time)[1]; | ||
// end TupleOperation1; | ||
// 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,41 @@ | ||
// name: TupleOperation2 | ||
// keywords: | ||
// status: correct | ||
// cflags: -d=newInst | ||
// | ||
|
||
function f | ||
input Real t; | ||
output Real x = 1.0; | ||
output Real y = 2.0; | ||
end f; | ||
|
||
function f2 | ||
input Real t; | ||
output Real x = 3.0; | ||
output Real y = 4.0; | ||
output Real z = 5.0; | ||
end f2; | ||
|
||
model TupleOperation2 | ||
Real x = f(time) + f2(time); | ||
end TupleOperation2; | ||
|
||
// Result: | ||
// function f | ||
// input Real t; | ||
// output Real x = 1.0; | ||
// output Real y = 2.0; | ||
// end f; | ||
// | ||
// function f2 | ||
// input Real t; | ||
// output Real x = 3.0; | ||
// output Real y = 4.0; | ||
// output Real z = 5.0; | ||
// end f2; | ||
// | ||
// class TupleOperation2 | ||
// Real x = f(time)[1] + f2(time)[1]; | ||
// end TupleOperation2; | ||
// 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,21 @@ | ||
// name: TupleOperation3 | ||
// keywords: | ||
// status: correct | ||
// cflags: -d=newInst | ||
// | ||
|
||
function f | ||
output Integer n1 = 2; | ||
output Integer n2 = 3; | ||
end f; | ||
|
||
model TupleOperation3 | ||
Real x[f()]; | ||
end TupleOperation3; | ||
|
||
// Result: | ||
// class TupleOperation3 | ||
// Real x[1]; | ||
// Real x[2]; | ||
// end TupleOperation3; | ||
// 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,35 @@ | ||
// name: TupleOperation4 | ||
// keywords: | ||
// status: correct | ||
// cflags: -d=newInst | ||
// | ||
|
||
function f | ||
input Real t; | ||
output Integer n1 = 2; | ||
output Integer n2 = 3; | ||
end f; | ||
|
||
model TupleOperation4 | ||
Real x[3]; | ||
Real y; | ||
equation | ||
y = x[f(time)]; | ||
end TupleOperation4; | ||
|
||
// Result: | ||
// function f | ||
// input Real t; | ||
// output Integer n1 = 2; | ||
// output Integer n2 = 3; | ||
// end f; | ||
// | ||
// class TupleOperation4 | ||
// Real x[1]; | ||
// Real x[2]; | ||
// Real x[3]; | ||
// Real y; | ||
// equation | ||
// y = x[f(time)[1]]; | ||
// end TupleOperation4; | ||
// endResult |