Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Belonging to [master]: - OpenModelica/OMCompiler#2448 - OpenModelica/OpenModelica-testsuite#951
- Loading branch information
1 parent
0559144
commit affad0b
Showing
9 changed files
with
185 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
// name: ClassMod1.mo | ||
// name: ClassMod1 | ||
// status: correct | ||
// cflags: -d=newInst | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
// name: ClassMod2.mo | ||
// name: ClassMod2 | ||
// status: correct | ||
// cflags: -d=newInst | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// name: ClassMod3 | ||
// status: correct | ||
// cflags: -d=newInst | ||
|
||
package P | ||
type T = Real; | ||
end P; | ||
|
||
model ClassMod3 | ||
package MyP = P(T(start = 1.0)); | ||
MyP.T t[3]; | ||
end ClassMod3; | ||
|
||
// Result: | ||
// class ClassMod3 | ||
// Real t[1](start = 1.0); | ||
// Real t[2](start = 1.0); | ||
// Real t[3](start = 1.0); | ||
// end ClassMod3; | ||
// endResult |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// name: ClassMod4 | ||
// status: correct | ||
// cflags: -d=newInst | ||
|
||
model A | ||
type T = Real; | ||
T t[3]; | ||
end A; | ||
|
||
model ClassMod4 | ||
A a(T(start = 1.0)); | ||
end ClassMod4; | ||
|
||
// Result: | ||
// class ClassMod4 | ||
// Real a.t[1](start = 1.0); | ||
// Real a.t[2](start = 1.0); | ||
// Real a.t[3](start = 1.0); | ||
// end ClassMod4; | ||
// endResult |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
// name: ClassMod5 | ||
// status: correct | ||
// cflags: -d=newInst | ||
|
||
model A | ||
type T = Real[3]; | ||
T t; | ||
end A; | ||
|
||
model A2 | ||
type T = Real[3]; | ||
T t[2]; | ||
end A2; | ||
|
||
model B | ||
A a; | ||
A2 a2; | ||
end B; | ||
|
||
model ClassMod5 | ||
B b[3](a(T(start = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}))); | ||
B b2(a2(each T(start = {1, 2, 3}))); | ||
end ClassMod5; | ||
|
||
// Result: | ||
// class ClassMod5 | ||
// Real b[1].a.t[1](start = 1.0); | ||
// Real b[1].a.t[2](start = 2.0); | ||
// Real b[1].a.t[3](start = 3.0); | ||
// Real b[1].a2.t[1,1]; | ||
// Real b[1].a2.t[1,2]; | ||
// Real b[1].a2.t[1,3]; | ||
// Real b[1].a2.t[2,1]; | ||
// Real b[1].a2.t[2,2]; | ||
// Real b[1].a2.t[2,3]; | ||
// Real b[2].a.t[1](start = 4.0); | ||
// Real b[2].a.t[2](start = 5.0); | ||
// Real b[2].a.t[3](start = 6.0); | ||
// Real b[2].a2.t[1,1]; | ||
// Real b[2].a2.t[1,2]; | ||
// Real b[2].a2.t[1,3]; | ||
// Real b[2].a2.t[2,1]; | ||
// Real b[2].a2.t[2,2]; | ||
// Real b[2].a2.t[2,3]; | ||
// Real b[3].a.t[1](start = 7.0); | ||
// Real b[3].a.t[2](start = 8.0); | ||
// Real b[3].a.t[3](start = 9.0); | ||
// Real b[3].a2.t[1,1]; | ||
// Real b[3].a2.t[1,2]; | ||
// Real b[3].a2.t[1,3]; | ||
// Real b[3].a2.t[2,1]; | ||
// Real b[3].a2.t[2,2]; | ||
// Real b[3].a2.t[2,3]; | ||
// Real b2.a.t[1]; | ||
// Real b2.a.t[2]; | ||
// Real b2.a.t[3]; | ||
// Real b2.a2.t[1,1](start = 1.0); | ||
// Real b2.a2.t[1,2](start = 2.0); | ||
// Real b2.a2.t[1,3](start = 3.0); | ||
// Real b2.a2.t[2,1](start = 1.0); | ||
// Real b2.a2.t[2,2](start = 2.0); | ||
// Real b2.a2.t[2,3](start = 3.0); | ||
// end ClassMod5; | ||
// endResult |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
// name: ClassMod6 | ||
// status: correct | ||
// cflags: -d=newInst | ||
|
||
model X | ||
Real x; | ||
end X; | ||
|
||
model A | ||
model T = X[3]; | ||
T t; | ||
end A; | ||
|
||
model A2 | ||
model T = X[3]; | ||
T t[2]; | ||
end A2; | ||
|
||
model B | ||
A a; | ||
A2 a2; | ||
end B; | ||
|
||
model ClassMod6 | ||
B b[3](a(T(x = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}))); | ||
B b2(a2(each T(x = {1, 2, 3}))); | ||
end ClassMod6; | ||
|
||
// Result: | ||
// class ClassMod6 | ||
// Real b[1].a.t[1].x = 1.0; | ||
// Real b[1].a.t[2].x = 2.0; | ||
// Real b[1].a.t[3].x = 3.0; | ||
// Real b[1].a2.t[1,1].x; | ||
// Real b[1].a2.t[1,2].x; | ||
// Real b[1].a2.t[1,3].x; | ||
// Real b[1].a2.t[2,1].x; | ||
// Real b[1].a2.t[2,2].x; | ||
// Real b[1].a2.t[2,3].x; | ||
// Real b[2].a.t[1].x = 4.0; | ||
// Real b[2].a.t[2].x = 5.0; | ||
// Real b[2].a.t[3].x = 6.0; | ||
// Real b[2].a2.t[1,1].x; | ||
// Real b[2].a2.t[1,2].x; | ||
// Real b[2].a2.t[1,3].x; | ||
// Real b[2].a2.t[2,1].x; | ||
// Real b[2].a2.t[2,2].x; | ||
// Real b[2].a2.t[2,3].x; | ||
// Real b[3].a.t[1].x = 7.0; | ||
// Real b[3].a.t[2].x = 8.0; | ||
// Real b[3].a.t[3].x = 9.0; | ||
// Real b[3].a2.t[1,1].x; | ||
// Real b[3].a2.t[1,2].x; | ||
// Real b[3].a2.t[1,3].x; | ||
// Real b[3].a2.t[2,1].x; | ||
// Real b[3].a2.t[2,2].x; | ||
// Real b[3].a2.t[2,3].x; | ||
// Real b2.a.t[1].x; | ||
// Real b2.a.t[2].x; | ||
// Real b2.a.t[3].x; | ||
// Real b2.a2.t[1,1].x = 1.0; | ||
// Real b2.a2.t[1,2].x = 2.0; | ||
// Real b2.a2.t[1,3].x = 3.0; | ||
// Real b2.a2.t[2,1].x = 1.0; | ||
// Real b2.a2.t[2,2].x = 2.0; | ||
// Real b2.a2.t[2,3].x = 3.0; | ||
// end ClassMod6; | ||
// endResult |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters