Skip to content

Commit

Permalink
- Added testcase for ticket 4028.
Browse files Browse the repository at this point in the history
  • Loading branch information
perost committed Aug 22, 2016
1 parent 05d7215 commit f12e83b
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
3 changes: 2 additions & 1 deletion flattening/modelica/built-in-functions/Makefile
Expand Up @@ -26,7 +26,7 @@ Delay8.mo \
DerConstant1.mo \
DerConstant2.mo \
DerConstant3.mo \
DiagonalSimplify1 \
DiagonalSimplify1.mo \
Div.mo \
EventFunctions.mo \
Exp.mo \
Expand Down Expand Up @@ -62,6 +62,7 @@ Sinh.mo \
Skew.mo \
Sqrt.mo \
Sum.mo \
SumArray.mo \
SumScalar.mo \
SumVar.mo \
Symmetric.mo \
Expand Down
26 changes: 26 additions & 0 deletions flattening/modelica/built-in-functions/SumArray.mo
@@ -0,0 +1,26 @@
// name: SumArray
// keywords: sum array #4028
// status: correct
//
// Tests that sum of a multidimensional array is constant evaluated correctly.
//

model SumArray
function f
input Integer [:,:,:] x;
output Integer y = sum(x);
end f;

constant Integer s = f({{{1, 2}}, {{3, 4}}});
end SumArray;

// Result:
// function SumArray.f
// input Integer[:, :, :] x;
// output Integer y = sum(x);
// end SumArray.f;
//
// class SumArray
// constant Integer s = 10;
// end SumArray;
// endResult

0 comments on commit f12e83b

Please sign in to comment.