Skip to content

Commit

Permalink
Update nfinst tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
perost authored and OpenModelica-Hudson committed Jan 31, 2018
1 parent 432c831 commit 87c4710
Show file tree
Hide file tree
Showing 24 changed files with 1,086 additions and 6 deletions.
4 changes: 2 additions & 2 deletions flattening/modelica/scodeinst/DimUnknown5.mo
Expand Up @@ -25,7 +25,7 @@ end DimUnknown5;
// Real y[2,2];
// Real y[2,3];
// equation
// x = {{y[1,1], y[1,2], y[1,3]}, {y[2,1], y[2,2], y[2,3]}};
// y = {{x[1,1], x[1,2], x[1,3]}, {x[2,1], x[2,2], x[2,3]}};
// x = y;
// y = x;
// end DimUnknown5;
// endResult
4 changes: 2 additions & 2 deletions flattening/modelica/scodeinst/EnumRangeBinding1.mo
Expand Up @@ -19,7 +19,7 @@ end EnumRangeBinding1;
// enumeration(one, two, three, four) e2[1];
// enumeration(one, two, three, four) e2[2];
// equation
// e1 = {E.one, E.two, E.three, E.four};
// e2 = {E.two, E.three};
// e1 = E.one:E.four;
// e2 = E.two:E.three;
// end EnumRangeBinding1;
// endResult
2 changes: 1 addition & 1 deletion flattening/modelica/scodeinst/FuncBuiltinInteger.mo
Expand Up @@ -16,6 +16,6 @@ end FuncBuiltinInteger;
// class FuncBuiltinInteger
// Integer r1 = integer(4.25);
// Integer r2 = integer(-9.9);
// Integer r3 = integer(r1 / r2);
// Integer r3 = integer(/*Real*/(r1) / /*Real*/(r2));
// end FuncBuiltinInteger;
// endResult
19 changes: 19 additions & 0 deletions flattening/modelica/scodeinst/Makefile
Expand Up @@ -424,6 +424,25 @@ NoEvent2.mo \
NonConnectorFlow1.mo \
NonexistentRedeclareModifier1.mo \
NonexistentRedeclareModifier2.mo \
OperationAdd1.mo \
OperationAddEW1.mo \
OperationDiv1.mo \
OperationDivEW1.mo \
OperationLogicalBinary1.mo \
OperationLogicalUnary1.mo \
OperationMatrixProduct1.mo \
OperationMatrixVectorProduct1.mo \
OperationMul1.mo \
OperationMulEW1.mo \
OperationPow1.mo \
OperationPow2.mo \
OperationPowEW1.mo \
OperationRelational1.mo \
OperationSub1.mo \
OperationSubEW1.mo \
OperationUnary1.mo \
OperationVectorMatrixProduct1.mo \
OperationVectorProduct1.mo \
PackageConstant1.mo \
ParameterBug.mos \
PropagateExtends.mo \
Expand Down
69 changes: 69 additions & 0 deletions flattening/modelica/scodeinst/OperationAdd1.mo
@@ -0,0 +1,69 @@
// name: OperationAdd1
// keywords:
// status: correct
// cflags: -d=newInst
//

model OperationAdd1
Integer i1;
Integer i2[2];
Integer i3[3, 3];
Real r1;
Real r2[2];
Real r3[3, 3];
String s1;
String s2[2];
equation
i1 = 1 + 2;
i2 = {1, 2} + {3, 4};
i3 = identity(3) + identity(3);
r1 = 1.0 + 2;
r2 = {1, 2.0} + {3.0, 4};
r3 = identity(3) + identity(3);
s1 = "hello" + " world";
s2 = {s1, s1} + {"1", "2"};
end OperationAdd1;

// Result:
// class OperationAdd1
// Integer i1;
// Integer i2[1];
// Integer i2[2];
// Integer i3[1,1];
// Integer i3[1,2];
// Integer i3[1,3];
// Integer i3[2,1];
// Integer i3[2,2];
// Integer i3[2,3];
// Integer i3[3,1];
// Integer i3[3,2];
// Integer i3[3,3];
// Real r1;
// Real r2[1];
// Real r2[2];
// Real r3[1,1];
// Real r3[1,2];
// Real r3[1,3];
// Real r3[2,1];
// Real r3[2,2];
// Real r3[2,3];
// Real r3[3,1];
// Real r3[3,2];
// Real r3[3,3];
// String s1;
// String s2[1];
// String s2[2];
// equation
// i1 = 1 + 2;
// i2[1] = 1 + 3;
// i2[2] = 2 + 4;
// i3 = identity(3) + identity(3);
// r1 = 1.0 + 2;
// r2[1] = 1 + 3.0;
// r2[2] = 2.0 + 4;
// r3 = /*Real[3, 3]*/(identity(3) + identity(3));
// s1 = "hello" + " world";
// s2[1] = s1 + "1";
// s2[2] = s1 + "2";
// end OperationAdd1;
// endResult
67 changes: 67 additions & 0 deletions flattening/modelica/scodeinst/OperationAddEW1.mo
@@ -0,0 +1,67 @@
// name: OperationAddEW1
// keywords:
// status: correct
// cflags: -d=newInst
//

model OperationAddEW1
Integer i1;
Integer i2[2];
Integer i3[3, 3];
Real r1;
Real r2[2];
equation
i2 = i2 .+ i1;
i2 = i1 .+ i2;
i3 = i3 .+ i1;
i3 = i1 .+ i3;
r2 = i2 .+ r1;
r2 = r1 .+ i2;
end OperationAddEW1;

// Result:
// class OperationAddEW1
// Integer i1;
// Integer i2[1];
// Integer i2[2];
// Integer i3[1,1];
// Integer i3[1,2];
// Integer i3[1,3];
// Integer i3[2,1];
// Integer i3[2,2];
// Integer i3[2,3];
// Integer i3[3,1];
// Integer i3[3,2];
// Integer i3[3,3];
// Real r1;
// Real r2[1];
// Real r2[2];
// equation
// i2[1] = i2[1] + i1;
// i2[2] = i2[2] + i1;
// i2[1] = i1 + i2[1];
// i2[2] = i1 + i2[2];
// i3[1,1] = i3[1,1] + i1;
// i3[1,2] = i3[1,2] + i1;
// i3[1,3] = i3[1,3] + i1;
// i3[2,1] = i3[2,1] + i1;
// i3[2,2] = i3[2,2] + i1;
// i3[2,3] = i3[2,3] + i1;
// i3[3,1] = i3[3,1] + i1;
// i3[3,2] = i3[3,2] + i1;
// i3[3,3] = i3[3,3] + i1;
// i3[1,1] = i1 + i3[1,1];
// i3[1,2] = i1 + i3[1,2];
// i3[1,3] = i1 + i3[1,3];
// i3[2,1] = i1 + i3[2,1];
// i3[2,2] = i1 + i3[2,2];
// i3[2,3] = i1 + i3[2,3];
// i3[3,1] = i1 + i3[3,1];
// i3[3,2] = i1 + i3[3,2];
// i3[3,3] = i1 + i3[3,3];
// r2[1] = /*Real*/(i2[1]) + r1;
// r2[2] = /*Real*/(i2[2]) + r1;
// r2[1] = r1 + /*Real*/(i2[1]);
// r2[2] = r1 + /*Real*/(i2[2]);
// end OperationAddEW1;
// endResult
53 changes: 53 additions & 0 deletions flattening/modelica/scodeinst/OperationDiv1.mo
@@ -0,0 +1,53 @@
// name: OperationDiv1
// keywords:
// status: correct
// cflags: -d=newInst
//

model OperationDiv1
Integer i1;
Integer i2[2];
Real r1;
Real r2[2];
Real r3[3, 3];
equation
r1 = r1 / r1;
r2 = r2 / r1;
r3 = r3 / r1;
r2 = i2 / i1;
end OperationDiv1;

// Result:
// class OperationDiv1
// Integer i1;
// Integer i2[1];
// Integer i2[2];
// Real r1;
// Real r2[1];
// Real r2[2];
// Real r3[1,1];
// Real r3[1,2];
// Real r3[1,3];
// Real r3[2,1];
// Real r3[2,2];
// Real r3[2,3];
// Real r3[3,1];
// Real r3[3,2];
// Real r3[3,3];
// equation
// r1 = r1 / r1;
// r2[1] = r2[1] / r1;
// r2[2] = r2[2] / r1;
// r3[1,1] = r3[1,1] / r1;
// r3[1,2] = r3[1,2] / r1;
// r3[1,3] = r3[1,3] / r1;
// r3[2,1] = r3[2,1] / r1;
// r3[2,2] = r3[2,2] / r1;
// r3[2,3] = r3[2,3] / r1;
// r3[3,1] = r3[3,1] / r1;
// r3[3,2] = r3[3,2] / r1;
// r3[3,3] = r3[3,3] / r1;
// r2[1] = /*Real*/(i2[1]) / /*Real*/(i1);
// r2[2] = /*Real*/(i2[2]) / /*Real*/(i1);
// end OperationDiv1;
// endResult
73 changes: 73 additions & 0 deletions flattening/modelica/scodeinst/OperationDivEW1.mo
@@ -0,0 +1,73 @@
// name: OperationDivEW1
// keywords:
// status: correct
// cflags: -d=newInst
//

model OperationDivEW1
Integer i1;
Integer i2[2];
Integer i3[3, 3];
Real r1;
Real r2[2];
Real r3[3, 3];
equation
r1 = r1 ./ r1;
r2 = r2 ./ r1;
r3 = r3 ./ r1;
r2 = i2 ./ i1;
r3 = r3 ./ i3;
end OperationDivEW1;

// Result:
// class OperationDivEW1
// Integer i1;
// Integer i2[1];
// Integer i2[2];
// Integer i3[1,1];
// Integer i3[1,2];
// Integer i3[1,3];
// Integer i3[2,1];
// Integer i3[2,2];
// Integer i3[2,3];
// Integer i3[3,1];
// Integer i3[3,2];
// Integer i3[3,3];
// Real r1;
// Real r2[1];
// Real r2[2];
// Real r3[1,1];
// Real r3[1,2];
// Real r3[1,3];
// Real r3[2,1];
// Real r3[2,2];
// Real r3[2,3];
// Real r3[3,1];
// Real r3[3,2];
// Real r3[3,3];
// equation
// r1 = r1 / r1;
// r2[1] = r2[1] / r1;
// r2[2] = r2[2] / r1;
// r3[1,1] = r3[1,1] / r1;
// r3[1,2] = r3[1,2] / r1;
// r3[1,3] = r3[1,3] / r1;
// r3[2,1] = r3[2,1] / r1;
// r3[2,2] = r3[2,2] / r1;
// r3[2,3] = r3[2,3] / r1;
// r3[3,1] = r3[3,1] / r1;
// r3[3,2] = r3[3,2] / r1;
// r3[3,3] = r3[3,3] / r1;
// r2[1] = /*Real*/(i2[1]) / /*Real*/(i1);
// r2[2] = /*Real*/(i2[2]) / /*Real*/(i1);
// r3[1,1] = r3[1,1] / /*Real*/(i3[1,1]);
// r3[1,2] = r3[1,2] / /*Real*/(i3[1,2]);
// r3[1,3] = r3[1,3] / /*Real*/(i3[1,3]);
// r3[2,1] = r3[2,1] / /*Real*/(i3[2,1]);
// r3[2,2] = r3[2,2] / /*Real*/(i3[2,2]);
// r3[2,3] = r3[2,3] / /*Real*/(i3[2,3]);
// r3[3,1] = r3[3,1] / /*Real*/(i3[3,1]);
// r3[3,2] = r3[3,2] / /*Real*/(i3[3,2]);
// r3[3,3] = r3[3,3] / /*Real*/(i3[3,3]);
// end OperationDivEW1;
// endResult
76 changes: 76 additions & 0 deletions flattening/modelica/scodeinst/OperationLogicalBinary1.mo
@@ -0,0 +1,76 @@
// name: OperationLogicalBinary1
// keywords:
// status: correct
// cflags: -d=newInst
//

model OperationLogicalBinary1
Boolean b1, b2;
Boolean[3] b3, b4;
Boolean[3, 3] b5, b6;
equation
b1 = b1 and b2;
b1 = b1 or b2;
b3 = b3 and b4;
b3 = b3 or b4;
b5 = b5 and b6;
b5 = b5 or b6;
end OperationLogicalBinary1;

// Result:
// class OperationLogicalBinary1
// Boolean b1;
// Boolean b2;
// Boolean b3[1];
// Boolean b3[2];
// Boolean b3[3];
// Boolean b4[1];
// Boolean b4[2];
// Boolean b4[3];
// Boolean b5[1,1];
// Boolean b5[1,2];
// Boolean b5[1,3];
// Boolean b5[2,1];
// Boolean b5[2,2];
// Boolean b5[2,3];
// Boolean b5[3,1];
// Boolean b5[3,2];
// Boolean b5[3,3];
// Boolean b6[1,1];
// Boolean b6[1,2];
// Boolean b6[1,3];
// Boolean b6[2,1];
// Boolean b6[2,2];
// Boolean b6[2,3];
// Boolean b6[3,1];
// Boolean b6[3,2];
// Boolean b6[3,3];
// equation
// b1 = b1 and b2;
// b1 = b1 or b2;
// b3[1] = b3[1] and b4[1];
// b3[2] = b3[2] and b4[2];
// b3[3] = b3[3] and b4[3];
// b3[1] = b3[1] or b4[1];
// b3[2] = b3[2] or b4[2];
// b3[3] = b3[3] or b4[3];
// b5[1,1] = b5[1,1] and b6[1,1];
// b5[1,2] = b5[1,2] and b6[1,2];
// b5[1,3] = b5[1,3] and b6[1,3];
// b5[2,1] = b5[2,1] and b6[2,1];
// b5[2,2] = b5[2,2] and b6[2,2];
// b5[2,3] = b5[2,3] and b6[2,3];
// b5[3,1] = b5[3,1] and b6[3,1];
// b5[3,2] = b5[3,2] and b6[3,2];
// b5[3,3] = b5[3,3] and b6[3,3];
// b5[1,1] = b5[1,1] or b6[1,1];
// b5[1,2] = b5[1,2] or b6[1,2];
// b5[1,3] = b5[1,3] or b6[1,3];
// b5[2,1] = b5[2,1] or b6[2,1];
// b5[2,2] = b5[2,2] or b6[2,2];
// b5[2,3] = b5[2,3] or b6[2,3];
// b5[3,1] = b5[3,1] or b6[3,1];
// b5[3,2] = b5[3,2] or b6[3,2];
// b5[3,3] = b5[3,3] or b6[3,3];
// end OperationLogicalBinary1;
// endResult

0 comments on commit 87c4710

Please sign in to comment.