Skip to content

Commit

Permalink
Add tests for concatenation
Browse files Browse the repository at this point in the history
  • Loading branch information
sjoelund authored and OpenModelica-Hudson committed Feb 27, 2018
1 parent cd5cd60 commit 77367d9
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
23 changes: 23 additions & 0 deletions flattening/modelica/scodeinst/Concatenation.mo
@@ -0,0 +1,23 @@
// status: correct
// cflags: -d=newInst

model Concatenation
Real z[1,2] = [{{2}},{1.0}];
Real z1[2,1,1] = [{{{2}}};{1.0}];
Real r[2] = cat(1, {1}, {2});
end Concatenation;

// Result:
// class Concatenation
// Real z[1,1];
// Real z[1,2];
// Real z1[1,1,1];
// Real z1[2,1,1];
// Real r[1];
// Real r[2];
// equation
// z = cat(2, {{2.0}}, promote({1.0}, 2));
// z1 = cat(1, /*Real[1, 1, 1]*/(promote({{{2}}}, 3)), promote({1.0}, 3));
// r = /*Real[2]*/(cat(1, {1}, {2}));
// end Concatenation;
// endResult
1 change: 1 addition & 0 deletions flattening/modelica/scodeinst/Makefile
Expand Up @@ -103,6 +103,7 @@ CompAsFunc.mo \
ComponentAsTypeError.mo \
ComponentAttributes1.mo \
ComponentAttributes2.mo \
Concatenation.mo \
cond4.mo \
Condition1.mo \
Condition2.mo \
Expand Down

0 comments on commit 77367d9

Please sign in to comment.