Skip to content

Commit

Permalink
[NF] Add test for duplicate params in function.
Browse files Browse the repository at this point in the history
  • Loading branch information
perost authored and OpenModelica-Hudson committed May 4, 2018
1 parent 9fbd53a commit 2377433
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
34 changes: 34 additions & 0 deletions flattening/modelica/scodeinst/FuncDuplicateParams1.mo
@@ -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
1 change: 1 addition & 0 deletions flattening/modelica/scodeinst/Makefile
Expand Up @@ -380,6 +380,7 @@ FuncBuiltinVectorWrongType1.mo \
FuncBuiltinZeros.mo \
FuncClassParam.mo \
FuncDefaultArg1.mo \
FuncDuplicateParams1.mo \
FuncExtends.mo \
FuncInnerParam.mo \
FuncInteger.mo \
Expand Down

0 comments on commit 2377433

Please sign in to comment.