File tree Expand file tree Collapse file tree 2 files changed +41
-0
lines changed
flattening/modelica/scodeinst Expand file tree Collapse file tree 2 files changed +41
-0
lines changed Original file line number Diff line number Diff line change 1+ // name: FuncDefaultArg2
2+ // keywords:
3+ // status: correct
4+ // cflags: -d=newInst
5+ //
6+ // Checks that default arguments are replaced with the correct expression in the
7+ // function call.
8+ //
9+
10+ function f
11+ input Real u1;
12+ input Real u2 = u1;
13+ output Real y;
14+ algorithm
15+ y := u1 + u2;
16+ end f;
17+
18+ model FuncDefaultArg2
19+ input Real a(start = 1 );
20+ output Real b;
21+ equation
22+ b = f(a);
23+ end FuncDefaultArg2;
24+
25+ // Result:
26+ // function f
27+ // input Real u1;
28+ // input Real u2 = u1;
29+ // output Real y;
30+ // algorithm
31+ // y := u1 + u2;
32+ // end f;
33+ //
34+ // class FuncDefaultArg2
35+ // input Real a(start = 1.0);
36+ // output Real b;
37+ // equation
38+ // b = f(a, a);
39+ // end FuncDefaultArg2;
40+ // endResult
Original file line number Diff line number Diff line change @@ -433,6 +433,7 @@ FuncBuiltinVectorWrongType1.mo \
433433FuncBuiltinZeros.mo \
434434FuncClassParam.mo \
435435FuncDefaultArg1.mo \
436+ FuncDefaultArg2.mo \
436437FuncDuplicateParams1.mo \
437438FuncExtends.mo \
438439FuncInnerParam.mo \
You can’t perform that action at this time.
0 commit comments