Skip to content

Commit

Permalink
[NF] Added dimension size test.
Browse files Browse the repository at this point in the history
- Reuse DimSize3 to test size in functions. DimSize3 was previously a
  duplicate of DimSize2.

Belonging to [master]:
  - OpenModelica/OMCompiler#2318
  - OpenModelica/OpenModelica-testsuite#899
  • Loading branch information
perost authored and OpenModelica-Hudson committed Mar 26, 2018
1 parent 21bec3c commit 6663e48
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions flattening/modelica/scodeinst/DimSize3.mo
Expand Up @@ -4,20 +4,22 @@
// cflags: -d=newInst
//

function f
input Real x[:, size(x, 1)];
end f;

model DimSize3
Real x[size(x, 2), 3];
algorithm
f({{1, 2}, {3, 4}});
end DimSize3;

// Result:
// function f
// input Real[:, size(x, 1)] x;
// end f;
//
// class DimSize3
// Real x[1,1];
// Real x[1,2];
// Real x[1,3];
// Real x[2,1];
// Real x[2,2];
// Real x[2,3];
// Real x[3,1];
// Real x[3,2];
// Real x[3,3];
// algorithm
// f({{1.0, 2.0}, {3.0, 4.0}});
// end DimSize3;
// endResult

0 comments on commit 6663e48

Please sign in to comment.