Skip to content

Commit 24f2259

Browse files
adrpoOpenModelica-Hudson
authored andcommitted
add test for ticket:5249
Belonging to [master]: - OpenModelica/OMCompiler#2836 - OpenModelica/OpenModelica-testsuite#1094
1 parent b7a3f0c commit 24f2259

File tree

3 files changed

+38
-1
lines changed

3 files changed

+38
-1
lines changed

flattening/modelica/scodeinst/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -742,6 +742,7 @@ Terminate1.mo \
742742
TerminateInvalid1.mo \
743743
TerminateInvalid2.mo \
744744
TestSampleNoClock.mos \
745+
Ticket5249.mo \
745746
Time1.mo \
746747
Time2.mo \
747748
Time3.mo \
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// name: Ticket5249.mo
2+
// keywords: tests if array binding works fine
3+
// status: correct
4+
//
5+
// cflags: -d=newInst
6+
//
7+
8+
model M
9+
10+
record X
11+
Real a;
12+
Real b;
13+
end X;
14+
constant Integer n = 2;
15+
X x[n] = {X(1, 2), X(2, 3)};
16+
17+
model H
18+
X x;
19+
end H;
20+
21+
H h[n](x = x);
22+
end M;
23+
24+
// Result:
25+
// class M
26+
// constant Integer n = 2;
27+
// Real x[1].a = 1.0;
28+
// Real x[1].b = 2.0;
29+
// Real x[2].a = 2.0;
30+
// Real x[2].b = 3.0;
31+
// Real h[1].x.a = x[1].a;
32+
// Real h[1].x.b = x[1].b;
33+
// Real h[2].x.a = x[2].a;
34+
// Real h[2].x.b = x[2].b;
35+
// end M;
36+
// endResult

partest/runtests.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
print(" -cppruntime Run ONLY the slow cppruntime tests.\n");
8787
print(" -nocpp Do not run any cppruntime tests.\n");
8888
print(" -f Only run fast tests.\n");
89-
print(" -file Reads testcases from the given file instead of from a makefile.\n");
89+
print(" -file=file Reads testcases from the given file instead of from a makefile.\n");
9090
print(" -jN Use N threads.\n");
9191
print(" -nodb Don't store timing data.\n");
9292
print(" -nosavedb Don't overwrite stored timing data.\n");

0 commit comments

Comments
 (0)