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#2069 - OpenModelica/OpenModelica-testsuite#801
- Loading branch information
1 parent
2c449d2
commit 851acf4
Showing
22 changed files
with
328 additions
and
75 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
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,32 @@ | ||
|
||
// name: End2 | ||
// keywords: | ||
// status: correct | ||
// cflags: -d=newInst | ||
// | ||
// | ||
|
||
model End2 | ||
Real x[3, 4, 1]; | ||
equation | ||
x[end, end, end] = 1; | ||
end End2; | ||
|
||
// Result: | ||
// class End2 | ||
// Real x[1,1,1]; | ||
// Real x[1,2,1]; | ||
// Real x[1,3,1]; | ||
// Real x[1,4,1]; | ||
// Real x[2,1,1]; | ||
// Real x[2,2,1]; | ||
// Real x[2,3,1]; | ||
// Real x[2,4,1]; | ||
// Real x[3,1,1]; | ||
// Real x[3,2,1]; | ||
// Real x[3,3,1]; | ||
// Real x[3,4,1]; | ||
// equation | ||
// x[3,4,1] = 1.0; | ||
// end End2; | ||
// 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,37 @@ | ||
// name: End3 | ||
// keywords: | ||
// status: correct | ||
// cflags: -d=newInst | ||
// | ||
// | ||
|
||
function last | ||
input Real x[:]; | ||
output Real y; | ||
algorithm | ||
y := x[end]; | ||
end last; | ||
|
||
model End3 | ||
Real x[3] = {1, 2, 3}; | ||
Real y = last(x); | ||
end End3; | ||
|
||
// Result: | ||
// function last | ||
// input Real[:] x; | ||
// output Real y; | ||
// algorithm | ||
// y := x[size(x, 1)]; | ||
// end last; | ||
// | ||
// class End3 | ||
// Real x[1]; | ||
// Real x[2]; | ||
// Real x[3]; | ||
// Real y = last(x); | ||
// equation | ||
// x = {1.0, 2.0, 3.0}; | ||
// end End3; | ||
// 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 was deleted.
Oops, something went wrong.
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: FuncBuiltinInitial1 | ||
// keywords: initial | ||
// status: correct | ||
// cflags: -d=newInst | ||
// | ||
// Tests the builtin initial operator. | ||
// | ||
|
||
model FuncBuiltinInitial1 | ||
Boolean b = initial(); | ||
end FuncBuiltinInitial1; | ||
|
||
// Result: | ||
// class FuncBuiltinInitial1 | ||
// Boolean b = initial(); | ||
// end FuncBuiltinInitial1; | ||
// 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: FuncBuiltinInitial2 | ||
// keywords: initial | ||
// status: incorrect | ||
// cflags: -d=newInst | ||
// | ||
// Tests the builtin initial operator. | ||
// | ||
|
||
model FuncBuiltinInitial2 | ||
parameter Boolean b = initial(); | ||
end FuncBuiltinInitial2; | ||
|
||
// Result: | ||
// Error processing file: FuncBuiltinInitial2.mo | ||
// [flattening/modelica/scodeinst/FuncBuiltinInitial2.mo:10:3-10:34:writable] Error: Component b of variability parameter has binding 'initial()' of higher variability discrete. | ||
// | ||
// # Error encountered! Exiting... | ||
// # Please check the error message and the flags. | ||
// | ||
// Execution failed! | ||
// endResult |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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: FuncBuiltinTerminal1 | ||
// keywords: terminal | ||
// status: correct | ||
// cflags: -d=newInst | ||
// | ||
// Tests the builtin terminal operator. | ||
// | ||
|
||
model FuncBuiltinTerminal1 | ||
Boolean b = terminal(); | ||
end FuncBuiltinTerminal1; | ||
|
||
// Result: | ||
// class FuncBuiltinTerminal1 | ||
// Boolean b = terminal(); | ||
// end FuncBuiltinTerminal1; | ||
// 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: FuncBuiltinTerminal2 | ||
// keywords: terminal | ||
// status: incorrect | ||
// cflags: -d=newInst | ||
// | ||
// Tests the builtin terminal operator. | ||
// | ||
|
||
model FuncBuiltinTerminal2 | ||
parameter Boolean b = terminal(); | ||
end FuncBuiltinTerminal2; | ||
|
||
// Result: | ||
// Error processing file: FuncBuiltinTerminal2.mo | ||
// [flattening/modelica/scodeinst/FuncBuiltinTerminal2.mo:10:3-10:35:writable] Error: Component b of variability parameter has binding 'terminal()' of higher variability discrete. | ||
// | ||
// # 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
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
Oops, something went wrong.