Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't move external object bindings to equations (#12185)
Fixes #12161
- Loading branch information
Showing
3 changed files
with
49 additions
and
2 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
45 changes: 45 additions & 0 deletions
45
testsuite/flattening/modelica/scodeinst/ExternalObject6.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,45 @@ | ||
// name: ExternalObject6 | ||
// keywords: | ||
// status: correct | ||
// cflags: -d=newInst | ||
// | ||
// | ||
|
||
model ExternalObject6 | ||
class EO | ||
extends ExternalObject; | ||
|
||
function constructor | ||
output EO e; | ||
external "C" e = init(); | ||
end constructor; | ||
|
||
function destructor | ||
input EO e; | ||
external "C" deinit(e); | ||
end destructor; | ||
end EO; | ||
|
||
parameter Integer N = 2; | ||
EO e[N] = {EO() for i in 1:N}; | ||
end ExternalObject6; | ||
|
||
// Result: | ||
// impure function ExternalObject6.EO.constructor | ||
// output ExternalObject6.EO e; | ||
// | ||
// external "C" e = init(); | ||
// end ExternalObject6.EO.constructor; | ||
// | ||
// impure function ExternalObject6.EO.destructor | ||
// input ExternalObject6.EO e; | ||
// | ||
// external "C" deinit(e); | ||
// end ExternalObject6.EO.destructor; | ||
// | ||
// class ExternalObject6 | ||
// final parameter Integer N = 2; | ||
// ExternalObject6.EO e[1] = ExternalObject6.EO.constructor(); | ||
// ExternalObject6.EO e[2] = ExternalObject6.EO.constructor(); | ||
// end ExternalObject6; | ||
// 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