-
Notifications
You must be signed in to change notification settings - Fork 423
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Danila Fedorin <[email protected]>
- Loading branch information
Showing
2 changed files
with
389 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
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,388 @@ | ||
module IncorrectIndentation { | ||
proc f1() | ||
{ | ||
writeln("hi"); | ||
writeln("??"); | ||
} | ||
|
||
@chplcheck.ignore("IncorrectIndentation") | ||
proc f2() | ||
{ | ||
writeln("hi"); | ||
} | ||
|
||
@chplcheck.ignore("IncorrectIndentation") | ||
proc f3() { | ||
writeln("hi"); | ||
} | ||
|
||
proc f4() { | ||
writeln("hi"); | ||
writeln("hi"); | ||
} | ||
|
||
proc f5() { | ||
writeln("hi"); writeln("hi"); | ||
} | ||
|
||
proc f6() { | ||
@chplcheck.ignore("IncorrectIndentation") | ||
for 1..10 do | ||
writeln("hi"); | ||
} | ||
|
||
module M1 | ||
{ | ||
writeln("hi"); | ||
writeln("??"); | ||
} | ||
|
||
@chplcheck.ignore("IncorrectIndentation") | ||
module M2 | ||
{ | ||
writeln("hi"); | ||
} | ||
|
||
@chplcheck.ignore("IncorrectIndentation") | ||
module M3 { | ||
writeln("hi"); | ||
} | ||
|
||
module M4 { | ||
writeln("hi"); | ||
writeln("hi"); | ||
} | ||
|
||
module M5 { | ||
writeln("hi"); writeln("hi"); | ||
} | ||
|
||
module M6 { | ||
@chplcheck.ignore("IncorrectIndentation") | ||
for 1..10 do | ||
writeln("hi"); | ||
} | ||
|
||
for 1..10 { | ||
writeln("hi"); | ||
} | ||
|
||
@chplcheck.ignore("IncorrectIndentation") | ||
for 1..10 | ||
{ | ||
writeln("hi"); | ||
} | ||
|
||
@chplcheck.ignore("IncorrectIndentation") | ||
for 1..10 { | ||
writeln("hi"); | ||
} | ||
|
||
module NestedOuter { | ||
module NestedInner { | ||
writeln("hi"); | ||
writeln("??"); | ||
writeln("??"); | ||
record nestedRecord { | ||
proc firstProc() {} | ||
proc secondProc() {} | ||
proc thirdProc() {} | ||
|
||
proc nestedProcOuter() { | ||
proc nestedProcInner(x: int) do return x; | ||
proc nestedProcInner(x: string) { | ||
writeln(x); | ||
writeln(x); | ||
writeln(x); | ||
return x; | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
on here | ||
{ | ||
writeln("hi"); | ||
writeln("??"); | ||
} | ||
|
||
@chplcheck.ignore("IncorrectIndentation") | ||
on here | ||
{ | ||
writeln("hi"); | ||
} | ||
|
||
@chplcheck.ignore("IncorrectIndentation") | ||
on here { | ||
writeln("hi"); | ||
} | ||
|
||
on here { | ||
writeln("hi"); | ||
writeln("hi"); | ||
} | ||
|
||
on here { | ||
writeln("hi"); writeln("hi"); | ||
} | ||
|
||
on here { | ||
@chplcheck.ignore("IncorrectIndentation") | ||
for 1..10 do | ||
writeln("hi"); | ||
} | ||
|
||
begin | ||
{ | ||
writeln("hi"); | ||
writeln("??"); | ||
} | ||
|
||
@chplcheck.ignore("IncorrectIndentation") | ||
begin | ||
{ | ||
writeln("hi"); | ||
} | ||
|
||
@chplcheck.ignore("IncorrectIndentation") | ||
begin { | ||
writeln("hi"); | ||
} | ||
|
||
begin { | ||
writeln("hi"); | ||
writeln("hi"); | ||
} | ||
|
||
begin { | ||
writeln("hi"); writeln("hi"); | ||
} | ||
|
||
begin { | ||
@chplcheck.ignore("IncorrectIndentation") | ||
for 1..10 do | ||
writeln("hi"); | ||
} | ||
|
||
var dummy: int; | ||
|
||
begin with (ref dummy) | ||
{ | ||
writeln("hi"); | ||
writeln("??"); | ||
} | ||
|
||
@chplcheck.ignore("IncorrectIndentation") | ||
begin with (ref dummy) | ||
{ | ||
writeln("hi"); | ||
} | ||
|
||
@chplcheck.ignore("IncorrectIndentation") | ||
begin with (ref dummy) { | ||
writeln("hi"); | ||
} | ||
|
||
begin with (ref dummy) { | ||
writeln("hi"); | ||
writeln("hi"); | ||
} | ||
|
||
begin with (ref dummy) { | ||
writeln("hi"); writeln("hi"); | ||
} | ||
|
||
begin with (ref dummy) { | ||
@chplcheck.ignore("IncorrectIndentation") | ||
for 1..10 do | ||
writeln("hi"); | ||
} | ||
|
||
// Note: 'cobegins' with one statement throw warning, so all tests here include | ||
// at least two statements. | ||
|
||
cobegin | ||
{ | ||
writeln("hi"); | ||
writeln("??"); | ||
} | ||
|
||
@chplcheck.ignore("IncorrectIndentation") | ||
cobegin | ||
{ | ||
writeln("hi"); | ||
writeln("hi"); | ||
} | ||
|
||
@chplcheck.ignore("IncorrectIndentation") | ||
cobegin { | ||
writeln("hi"); | ||
writeln("hi"); | ||
} | ||
|
||
cobegin { | ||
writeln("hi"); | ||
writeln("hi"); | ||
} | ||
|
||
cobegin { | ||
writeln("hi"); writeln("hi"); | ||
} | ||
|
||
cobegin { | ||
writeln("hi"); | ||
@chplcheck.ignore("IncorrectIndentation") | ||
for 1..10 do | ||
writeln("hi"); | ||
} | ||
|
||
cobegin with (ref dummy) | ||
{ | ||
writeln("hi"); | ||
writeln("??"); | ||
} | ||
|
||
cobegin with (ref dummy) | ||
{ | ||
writeln("hi"); | ||
writeln("hi"); | ||
} | ||
|
||
cobegin with (ref dummy) { | ||
writeln("hi"); | ||
writeln("hi"); | ||
} | ||
|
||
cobegin with (ref dummy) { | ||
writeln("hi"); | ||
writeln("hi"); | ||
} | ||
|
||
cobegin with (ref dummy) { | ||
writeln("hi"); writeln("hi"); | ||
} | ||
|
||
cobegin with (ref dummy) { | ||
writeln("hi"); | ||
@chplcheck.ignore("IncorrectIndentation") | ||
for 1..10 do | ||
writeln("hi"); | ||
} | ||
|
||
enum e1 | ||
{ | ||
first, | ||
second | ||
} | ||
|
||
@chplcheck.ignore("IncorrectIndentation") | ||
enum e2 | ||
{ | ||
first | ||
} | ||
|
||
@chplcheck.ignore("IncorrectIndentation") | ||
enum e3 { | ||
first | ||
} | ||
|
||
enum e4 { | ||
first, | ||
second | ||
} | ||
|
||
enum e5 { | ||
first, second | ||
} | ||
|
||
union u1 | ||
{ | ||
var element: int; | ||
proc firstProc() {} | ||
} | ||
|
||
@chplcheck.ignore("IncorrectIndentation") | ||
union u2 | ||
{ | ||
var element: int; | ||
|
||
proc firstProc() {} | ||
} | ||
|
||
@chplcheck.ignore("IncorrectIndentation") | ||
union u3 { | ||
var element: int; | ||
|
||
proc firstProc() {} | ||
} | ||
|
||
union u4 { | ||
var element: int; | ||
|
||
proc firstProc() {} | ||
proc secondProc() {} | ||
} | ||
|
||
union u5 { | ||
var element: int; | ||
|
||
proc firstProc() {} proc secondProc() {} | ||
} | ||
|
||
enum color { red, green, blue } // semicolon warning does not issue bad indentation | ||
|
||
// Since locations are incorrectly reported with 'public' and 'private', | ||
// these shouldn't warn. | ||
module M7 { | ||
proc f1 {} | ||
proc g1 {} | ||
public proc f2 {} | ||
public proc g2 {} | ||
private proc f3 {} | ||
private proc g3 {} | ||
|
||
use super.M1; | ||
use super.M1; | ||
public use super.M2; | ||
public use super.M2; | ||
private use super.M2; | ||
private use super.M2; | ||
} | ||
|
||
|
||
@chplcheck.ignore("IncorrectIndentation") | ||
module DirectChildrenNotIndented { | ||
proc f1() | ||
{ | ||
writeln("hi"); | ||
writeln("??"); | ||
} | ||
|
||
@chplcheck.ignore("IncorrectIndentation") | ||
proc f2() | ||
{ | ||
writeln("hi"); | ||
} | ||
|
||
@chplcheck.ignore("IncorrectIndentation") | ||
proc f3() { | ||
writeln("hi"); | ||
} | ||
|
||
proc f4() { | ||
writeln("hi"); | ||
writeln("hi"); | ||
} | ||
|
||
proc f5() { | ||
writeln("hi"); writeln("hi"); | ||
} | ||
|
||
proc f6() { | ||
@chplcheck.ignore("IncorrectIndentation") | ||
for 1..10 do | ||
writeln("hi"); | ||
} | ||
} | ||
} |