-
Notifications
You must be signed in to change notification settings - Fork 424
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add tests for use domain formal before defined
Signed-off-by: Ahmad Rezaii <[email protected]>
- Loading branch information
Showing
2 changed files
with
17 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
proc domainArgsInRange(matrix:[0..#D1][0..#D2] real, D1 : int, D2 : int) { | ||
// should be an error to use D1 and D2 before defined | ||
} | ||
|
||
proc domainArg(ref A:[dom1] real, ref B:[dom1] real, dom1:domain(1)) { | ||
// should be an error to use dom1 before defined | ||
} |
10 changes: 10 additions & 0 deletions
10
test/domains/compilerErrors/domainFormalUseBeforeDefine.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,10 @@ | ||
domainFormalUseBeforeDefine.chpl:1: In function 'domainArgsInRange': | ||
domainFormalUseBeforeDefine.chpl:1: error: statement references variable 'D1' before it is defined | ||
domainFormalUseBeforeDefine.chpl:1: note: the variable 'D1' is defined here | ||
domainFormalUseBeforeDefine.chpl:1: error: statement references variable 'D2' before it is defined | ||
domainFormalUseBeforeDefine.chpl:1: note: the variable 'D2' is defined here | ||
domainFormalUseBeforeDefine.chpl:5: In function 'domainArg': | ||
domainFormalUseBeforeDefine.chpl:5: error: statement references variable 'dom1' before it is defined | ||
domainFormalUseBeforeDefine.chpl:5: note: the variable 'dom1' is defined here | ||
domainFormalUseBeforeDefine.chpl:5: error: statement references variable 'dom1' before it is defined | ||
domainFormalUseBeforeDefine.chpl:5: note: the variable 'dom1' is defined here |