Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
including the case shown in issue chapel-lang#17241.

---
Signed-off-by: Michael Ferguson <mppf@users.noreply.github.com>
  • Loading branch information
mppf committed Feb 23, 2021
1 parent f7e96fe commit a5eb30b
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
proc f(inout arg) {
compilerWarning("in f, arg.type is ", arg.type:string);
writeln("in f, arg= ", arg);
arg = 1;
}
{
var A:[1..10] int;
ref slice = A[1..3];
f(slice);
writeln(slice);
writeln(A);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bug: core dump when passing a slice to a generic inout formal
#17241
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
bb.chpl:9: warning: [domain(1,int(64),false)] int(64)
in f, arg= 0 0 0
1 1 1
1 1 1 0 0 0 0 0 0 0
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CHPL_TEST_VGRND_EXE!=on
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
proc f(inout arg) {
writeln("in f, arg= ", arg);
arg = 1;
}
{
var A:[1..10] int;
ref slice = A[1..3];
f(slice);
writeln(slice);
}


proc g(inout arg: [1..3] int) {
writeln("in g, arg= ", arg);
arg = 2;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
in g, arg= 0 0 0
2 2 2

0 comments on commit a5eb30b

Please sign in to comment.