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#2881 - OpenModelica/OpenModelica-testsuite#1107
- Loading branch information
1 parent
84a90a3
commit 6307dbc
Showing
5 changed files
with
88 additions
and
0 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
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: ReductionInvalidTypeMax | ||
// keywords: reduction | ||
// status: incorrect | ||
// cflags: -d=newInst | ||
// | ||
// Tests the builtin reduction operators. | ||
// | ||
|
||
model ReductionInvalidTypeMax | ||
Real x = max("test" for i in 1:3); | ||
end ReductionInvalidTypeMax; | ||
|
||
// Result: | ||
// Error processing file: ReductionInvalidTypeMax.mo | ||
// [flattening/modelica/scodeinst/ReductionInvalidTypeMax.mo:10:3-10:36:writable] Error: Invalid expression ‘"test"‘ of type String in max reduction, expected scalar enumeration, Boolean, Integer or Real. | ||
// | ||
// # 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: ReductionInvalidTypeMin | ||
// keywords: reduction | ||
// status: incorrect | ||
// cflags: -d=newInst | ||
// | ||
// Tests the builtin reduction operators. | ||
// | ||
|
||
model ReductionInvalidTypeMin | ||
Real x = min({1, 2, 3} for i in 1:3); | ||
end ReductionInvalidTypeMin; | ||
|
||
// Result: | ||
// Error processing file: ReductionInvalidTypeMin.mo | ||
// [flattening/modelica/scodeinst/ReductionInvalidTypeMin.mo:10:3-10:39:writable] Error: Invalid expression ‘{1, 2, 3}‘ of type Integer[3] in min reduction, expected scalar enumeration, Boolean, Integer or Real. | ||
// | ||
// # Error encountered! Exiting... | ||
// # Please check the error message and the flags. | ||
// | ||
// Execution failed! | ||
// endResult |
21 changes: 21 additions & 0 deletions
21
flattening/modelica/scodeinst/ReductionInvalidTypeProduct.mo
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: ReductionInvalidTypeProduct | ||
// keywords: reduction | ||
// status: incorrect | ||
// cflags: -d=newInst | ||
// | ||
// Tests the builtin reduction operators. | ||
// | ||
|
||
model ReductionInvalidTypeProduct | ||
Real x = product({1, 2, 3} for i in 1:3); | ||
end ReductionInvalidTypeProduct; | ||
|
||
// Result: | ||
// Error processing file: ReductionInvalidTypeProduct.mo | ||
// [flattening/modelica/scodeinst/ReductionInvalidTypeProduct.mo:10:3-10:43:writable] Error: Invalid expression ‘{1, 2, 3}‘ of type Integer[3] in product reduction, expected scalar Integer or Real. | ||
// | ||
// # 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: ReductionInvalidTypeSum | ||
// keywords: reduction | ||
// status: incorrect | ||
// cflags: -d=newInst | ||
// | ||
// Tests the builtin reduction operators. | ||
// | ||
|
||
model ReductionInvalidTypeSum | ||
Real x = sum("test" for i in 1:3); | ||
end ReductionInvalidTypeSum; | ||
|
||
// Result: | ||
// Error processing file: ReductionInvalidTypeSum.mo | ||
// [flattening/modelica/scodeinst/ReductionInvalidTypeSum.mo:10:3-10:36:writable] Error: Invalid expression ‘"test"‘ of type String in sum reduction, expected Integer or Real. | ||
// | ||
// # Error encountered! Exiting... | ||
// # Please check the error message and the flags. | ||
// | ||
// Execution failed! | ||
// endResult |