Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test for 16301 and adjust test of const checking domain task intent
- Loading branch information
Showing
3 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
test/parallel/forall/checks/forall-inout-domain-bug-16301.chpl
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,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 | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
test/parallel/forall/checks/forall-inout-domain-bug-16301.good
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,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 |
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