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#2383 - OpenModelica/OpenModelica-testsuite#928
- Loading branch information
1 parent
14f66e7
commit 1787fde
Showing
8 changed files
with
113 additions
and
5 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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// name: EnumInvalidLiteralName1 | ||
// keywords: | ||
// status: incorrect | ||
// cflags: -d=newInst | ||
// | ||
|
||
model EnumInvalidLiteralName1 | ||
type E = enumeration(start, min, max); | ||
E e; | ||
end EnumInvalidLiteralName1; | ||
|
||
// Result: | ||
// Error processing file: EnumInvalidLiteralName1.mo | ||
// [flattening/modelica/scodeinst/EnumInvalidLiteralName1.mo:8:3-8:40:writable] Error: An element with name start is already declared in this scope. | ||
// | ||
// # Error encountered! Exiting... | ||
// # Please check the error message and the flags. | ||
// | ||
// Execution failed! | ||
// 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,43 @@ | ||
// name: EqualityConstraint1 | ||
// keywords: | ||
// status: correct | ||
// cflags: -d=newInst | ||
// | ||
|
||
type Real3 = Real[3]; | ||
|
||
type OC | ||
extends Real3; | ||
|
||
function equalityConstraint | ||
input OC oc1; | ||
input OC oc2; | ||
output Real residue[0]; | ||
end equalityConstraint; | ||
end OC; | ||
|
||
model EqualityConstraint1 | ||
OC oc1, oc2; | ||
equation | ||
OC.equalityConstraint(oc1, oc2); | ||
end EqualityConstraint1; | ||
|
||
|
||
// Result: | ||
// function OC.equalityConstraint | ||
// input Real[3] oc1; | ||
// input Real[3] oc2; | ||
// output Real[0] residue; | ||
// end OC.equalityConstraint; | ||
// | ||
// class EqualityConstraint1 | ||
// Real oc1[1]; | ||
// Real oc1[2]; | ||
// Real oc1[3]; | ||
// Real oc2[1]; | ||
// Real oc2[2]; | ||
// Real oc2[3]; | ||
// equation | ||
// OC.equalityConstraint(oc1, oc2); | ||
// end EqualityConstraint1; | ||
// 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// name: TypeExtends1 | ||
// keywords: | ||
// status: correct | ||
// cflags: -d=newInst | ||
// | ||
|
||
type MyReal | ||
extends Real(min = 1.0); | ||
end MyReal; | ||
|
||
model TypeExtends1 | ||
MyReal x(start = 1.0); | ||
end TypeExtends1; | ||
|
||
// Result: | ||
// class TypeExtends1 | ||
// Real x(min = 1.0, start = 1.0); | ||
// end TypeExtends1; | ||
// 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,22 @@ | ||
// name: TypeMissingBaseType1 | ||
// keywords: | ||
// status: incorrect | ||
// cflags: -d=newInst | ||
// | ||
|
||
type T | ||
end T; | ||
|
||
model TypeMissingBaseType1 | ||
T t; | ||
end TypeMissingBaseType1; | ||
|
||
// Result: | ||
// Error processing file: TypeMissingBaseType1.mo | ||
// [flattening/modelica/scodeinst/TypeMissingBaseType1.mo:7:1-8:6:writable] Error: Type ‘T‘ does not extend a basic type. | ||
// | ||
// # Error encountered! Exiting... | ||
// # Please check the error message and the flags. | ||
// | ||
// Execution failed! | ||
// 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
// cflags: -d=newInst | ||
// | ||
|
||
model MyReal | ||
type MyReal | ||
extends Real; | ||
end MyReal; | ||
|
||
|
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 |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
// cflags: -d=newInst | ||
// | ||
|
||
model MyReal | ||
type MyReal | ||
extends Real; | ||
Real y; | ||
end MyReal; | ||
|