Skip to content

Commit

Permalink
Add test for 16301 and adjust test of const checking domain task intent
Browse files Browse the repository at this point in the history
  • Loading branch information
mppf committed Aug 26, 2020
1 parent 83307b4 commit a442dff
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/parallel/forall/checks/forall-inout-domain-bug-16301.chpl
@@ -0,0 +1,14 @@
config const n = 1;

proc main() {
var D = {1..3};

foo(D);
}

proc foo(inout D: domain(1)) {

forall i in 1..n { // task intent required?
D = {2..4}; // race if n > 1
}
}
@@ -0,0 +1,3 @@
forall-inout-domain-bug-16301.chpl:9: In function 'foo':
forall-inout-domain-bug-16301.chpl:12: error: cannot assign to const variable
forall-inout-domain-bug-16301.chpl:11: note: The shadow variable 'D' is constant due to forall intents in this loop
12 changes: 12 additions & 0 deletions test/parallel/taskPar/taskIntents/03-error-in-fun.good
Expand Up @@ -360,6 +360,10 @@
03-error-in-fun.chpl:785: note: The shadow variable 'enm' is constant due to task intents in this begin statement
03-error-in-fun.chpl:810: error: cannot assign to const variable
03-error-in-fun.chpl:785: note: The shadow variable 'cls' is constant due to task intents in this begin statement
03-error-in-fun.chpl:812: error: cannot assign to const variable
03-error-in-fun.chpl:785: note: The shadow variable 'dom1' is constant due to task intents in this begin statement
03-error-in-fun.chpl:813: error: cannot assign to const variable
03-error-in-fun.chpl:785: note: The shadow variable 'dom2' is constant due to task intents in this begin statement
03-error-in-fun.chpl:819: error: cannot assign to const variable
03-error-in-fun.chpl:817: note: The shadow variable 'b0' is constant due to task intents in this parallel statement
03-error-in-fun.chpl:820: error: cannot assign to const variable
Expand Down Expand Up @@ -402,6 +406,10 @@
03-error-in-fun.chpl:817: note: The shadow variable 'enm' is constant due to task intents in this parallel statement
03-error-in-fun.chpl:842: error: cannot assign to const variable
03-error-in-fun.chpl:817: note: The shadow variable 'cls' is constant due to task intents in this parallel statement
03-error-in-fun.chpl:844: error: cannot assign to const variable
03-error-in-fun.chpl:817: note: The shadow variable 'dom1' is constant due to task intents in this parallel statement
03-error-in-fun.chpl:845: error: cannot assign to const variable
03-error-in-fun.chpl:817: note: The shadow variable 'dom2' is constant due to task intents in this parallel statement
03-error-in-fun.chpl:851: error: cannot assign to const variable
03-error-in-fun.chpl:849: note: The shadow variable 'b0' is constant due to task intents in this parallel statement
03-error-in-fun.chpl:852: error: cannot assign to const variable
Expand Down Expand Up @@ -444,6 +452,10 @@
03-error-in-fun.chpl:849: note: The shadow variable 'enm' is constant due to task intents in this parallel statement
03-error-in-fun.chpl:874: error: cannot assign to const variable
03-error-in-fun.chpl:849: note: The shadow variable 'cls' is constant due to task intents in this parallel statement
03-error-in-fun.chpl:876: error: cannot assign to const variable
03-error-in-fun.chpl:849: note: The shadow variable 'dom1' is constant due to task intents in this parallel statement
03-error-in-fun.chpl:877: error: cannot assign to const variable
03-error-in-fun.chpl:849: note: The shadow variable 'dom2' is constant due to task intents in this parallel statement
03-error-in-fun.chpl:921: In function 'funOut':
03-error-in-fun.chpl:957: error: cannot assign to const variable
03-error-in-fun.chpl:955: note: The shadow variable 'b0' is constant due to task intents in this begin statement
Expand Down

0 comments on commit a442dff

Please sign in to comment.