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#2826 - OpenModelica/OpenModelica-testsuite#1089
- Loading branch information
1 parent
db3e5da
commit 50c7598
Showing
3 changed files
with
64 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,28 @@ | ||
// name: RecordConstructor1 | ||
// keywords: | ||
// status: correct | ||
// cflags: -d=newInst | ||
// | ||
|
||
record R | ||
Real x; | ||
end R; | ||
|
||
model RecordConstructor1 | ||
R r; | ||
algorithm | ||
r := R(time); | ||
end RecordConstructor1; | ||
|
||
// Result: | ||
// function R "Automatically generated record constructor for R" | ||
// input Real x; | ||
// output R res; | ||
// end R; | ||
// | ||
// class RecordConstructor1 | ||
// Real r.x; | ||
// algorithm | ||
// r := R(time); | ||
// end RecordConstructor1; | ||
// 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,34 @@ | ||
// name: RecordConstructor2 | ||
// keywords: | ||
// status: correct | ||
// cflags: -d=newInst | ||
// | ||
// Checks that constants in a record becomes protected in the default | ||
// constructor. | ||
// | ||
|
||
record R | ||
Real x; | ||
constant Real y = 1.0; | ||
end R; | ||
|
||
model RecordConstructor2 | ||
R r; | ||
algorithm | ||
r := R(time); | ||
end RecordConstructor2; | ||
|
||
// Result: | ||
// function R "Automatically generated record constructor for R" | ||
// input Real x; | ||
// protected Real y = 1.0; | ||
// output R res; | ||
// end R; | ||
// | ||
// class RecordConstructor2 | ||
// Real r.x; | ||
// constant Real r.y = 1.0; | ||
// algorithm | ||
// r := R(time); | ||
// end RecordConstructor2; | ||
// endResult |