Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1a22a75
commit e4efaec
Showing
33 changed files
with
367 additions
and
157 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: DimCyclic1 | ||
// keywords: | ||
// status: incorrect | ||
// cflags: -d=newInst | ||
// | ||
|
||
model DimCyclic1 | ||
Real x[size(x, 2), size(x, 1)] = {{1, 2, 3}, {4, 5, 6}}; | ||
end DimCyclic1; | ||
|
||
|
||
// Result: | ||
// Error processing file: DimCyclic1.mo | ||
// [flattening/modelica/scodeinst/DimCyclic1.mo:8:3-8:58:writable] Error: Dimension 1 of x, 'size(x, 2)', could not be evaluated due to a cyclic dependency. | ||
// | ||
// # 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,21 @@ | ||
// name: DimCyclic2 | ||
// keywords: | ||
// status: incorrect | ||
// cflags: -d=newInst | ||
// | ||
|
||
model DimCyclic2 | ||
Real x[size(y, 1)]; | ||
Real y[size(x, 1)]; | ||
end DimCyclic2; | ||
|
||
|
||
// Result: | ||
// Error processing file: DimCyclic2.mo | ||
// [flattening/modelica/scodeinst/DimCyclic2.mo:8:3-8:21:writable] Error: Dimension 1 of x, 'size(y, 1)', could not be evaluated due to a cyclic dependency. | ||
// | ||
// # 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,20 @@ | ||
// name: DimCyclic3 | ||
// keywords: | ||
// status: incorrect | ||
// cflags: -d=newInst | ||
// | ||
// | ||
|
||
model DimCyclic3 | ||
Real x[size(x,1)] = {1, 2, 3}; | ||
end DimCyclic3; | ||
|
||
// Result: | ||
// Error processing file: DimCyclic3.mo | ||
// [flattening/modelica/scodeinst/DimCyclic3.mo:9:3-9:32:writable] Error: Dimension 1 of x, 'size(x, 1)', could not be evaluated due to a cyclic dependency. | ||
// | ||
// # 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,21 @@ | ||
// name: DimCyclic4 | ||
// keywords: | ||
// status: incorrect | ||
// cflags: -d=newInst | ||
// | ||
// | ||
|
||
model DimCyclic4 | ||
parameter Integer i = size(x, 2); | ||
Real x[i, i + 2] = {{1, 2, 3}, {4, 5, 6}}; | ||
end DimCyclic4; | ||
|
||
// Result: | ||
// Error processing file: DimCyclic4.mo | ||
// [flattening/modelica/scodeinst/DimCyclic4.mo:9:3-9:35:writable] Error: Dimension 2 of x, '(i + 2)', could not be evaluated due to a cyclic dependency. | ||
// | ||
// # 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,21 @@ | ||
// name: DimSize1 | ||
// keywords: | ||
// status: correct | ||
// cflags: -d=newInst | ||
// | ||
|
||
model DimSize1 | ||
Real x[3]; | ||
Real y[size(x, 1)]; | ||
end DimSize1; | ||
|
||
// Result: | ||
// class DimSize1 | ||
// Real x[1]; | ||
// Real x[2]; | ||
// Real x[3]; | ||
// Real y[1]; | ||
// Real y[2]; | ||
// Real y[3]; | ||
// end DimSize1; | ||
// 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,23 @@ | ||
// name: DimSize2 | ||
// keywords: | ||
// status: correct | ||
// cflags: -d=newInst | ||
// | ||
|
||
model DimSize2 | ||
Real x[size(x, 2), 3]; | ||
end DimSize2; | ||
|
||
// Result: | ||
// class DimSize2 | ||
// 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]; | ||
// end DimSize2; | ||
// 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,23 @@ | ||
// name: DimSize3 | ||
// keywords: | ||
// status: correct | ||
// cflags: -d=newInst | ||
// | ||
|
||
model DimSize3 | ||
Real x[size(x, 2), 3]; | ||
end DimSize3; | ||
|
||
// Result: | ||
// 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]; | ||
// end DimSize3; | ||
// 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
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
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,17 @@ | ||
// name: Size2 | ||
// keywords: size | ||
// status: correct | ||
// cflags: -d=newInst | ||
// | ||
// Tests the builtin size operator. | ||
// | ||
|
||
model Size2 | ||
Integer x = size({1, 2, 3}, 1); | ||
end Size2; | ||
|
||
// Result: | ||
// class Size2 | ||
// Integer x = 3; | ||
// end Size2; | ||
// 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: SizeInvalidIndex1 | ||
// keywords: size | ||
// status: incorrect | ||
// cflags: -d=newInst | ||
// | ||
// Tests the builtin size operator. | ||
// | ||
|
||
model SizeInvalidIndex1 | ||
Real x[2, 3]; | ||
Integer y = size(x, 3); | ||
end SizeInvalidIndex1; | ||
|
||
// Result: | ||
// Error processing file: SizeInvalidIndex1.mo | ||
// [flattening/modelica/scodeinst/SizeInvalidIndex1.mo:11:3-11:25:writable] Error: Invalid index 3 in call to size of x, valid index interval is [1,2]. | ||
// | ||
// # 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,22 @@ | ||
// name: SizeInvalidIndex2 | ||
// keywords: size | ||
// status: incorrect | ||
// cflags: -d=newInst | ||
// | ||
// Tests the builtin size operator. | ||
// | ||
|
||
model SizeInvalidIndex2 | ||
Real x[2, 3]; | ||
Integer y = size(x, -1); | ||
end SizeInvalidIndex2; | ||
|
||
// Result: | ||
// Error processing file: SizeInvalidIndex2.mo | ||
// [flattening/modelica/scodeinst/SizeInvalidIndex2.mo:11:3-11:26:writable] Error: Invalid index -1 in call to size of x, valid index interval is [1,2]. | ||
// | ||
// # Error encountered! Exiting... | ||
// # Please check the error message and the flags. | ||
// | ||
// Execution failed! | ||
// endResult |
Oops, something went wrong.