Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[NF] Add test for duplicate params in function.
Belonging to [master]: - OpenModelica/OMCompiler#2410 - OpenModelica/OpenModelica-testsuite#937
- Loading branch information
1 parent
9fbd53a
commit 2377433
Showing
2 changed files
with
35 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,34 @@ | ||
// name: FuncDuplicateParams1 | ||
// keywords: | ||
// status: correct | ||
// cflags: -d=newInst | ||
// | ||
// Checks that duplicate elements are handled correctly in functions. | ||
// | ||
|
||
function f1 | ||
input Real x; | ||
output Real y; | ||
end f1; | ||
|
||
function f2 | ||
input Real x; | ||
output Real y; | ||
end f2; | ||
|
||
function f | ||
extends f1; | ||
extends f2; | ||
algorithm | ||
y := x; | ||
end f; | ||
|
||
model FuncDuplicateParams1 | ||
constant Real x = f(1.0); | ||
end FuncDuplicateParams1; | ||
|
||
// Result: | ||
// class FuncDuplicateParams1 | ||
// constant Real x = 1.0; | ||
// end FuncDuplicateParams1; | ||
// 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