Debian Codegraph @

gcc/testsuite/c-c++-common/cpp/Wleading-whitespace-1.c

raw
1 /* { dg-do compile { target { c || c++11 } } } */
2 /* { dg-options "-Wleading-whitespace=blanks" } */
3
4 int i1; /* 4 spaces ok for -ftabstop=8 */
5 int i2; /* 2 tabs 7 spaces ok for -ftabstop=8 */
6 int i3; /* 8 spaces not ok */
7 /* { dg-warning "too many consecutive spaces in leading whitespace" "" { target *-*-* } .-1 } */
8 int i4; /* tab 8 spaces not ok */
9 /* { dg-warning "too many consecutive spaces in leading whitespace" "" { target *-*-* } .-1 } */
10 int i5; /* 4 spaces tab not ok */
11 /* { dg-warning "tab after space in leading whitespace" "" { target *-*-* } .-1 } */
12 int i6; /* space tab not ok */
13 /* { dg-warning "tab after space in leading whitespace" "" { target *-*-* } .-1 } */
14 int i7; /* tab vtab not ok */
15 /* { dg-warning "whitespace other than spaces and tabs in leading whitespace" "" { target *-*-* } .-1 } */
16 int i8; /* tab form-feed not ok */
17 /* { dg-warning "whitespace other than spaces and tabs in leading whitespace" "" { target *-*-* } .-1 } */
18 int i9; /* 4 spaces vtab not ok */
19 /* { dg-warning "whitespace other than spaces and tabs in leading whitespace" "" { target *-*-* } .-1 } */
20 int i10; /* 2 spaces form-feed not ok */
21 /* { dg-warning "whitespace other than spaces and tabs in leading whitespace" "" { target *-*-* } .-1 } */
22
23 /* Just whitespace on a line is something for -Wtrailing-whitespace. */
24 int \
25 i11, \
26 i12, \
27 i13, \
28 i14, \
29 i15, \
30 i16, \
31 i17;
32 /* { dg-warning "too many consecutive spaces in leading whitespace" "" { target *-*-* } .-5 } */
33 /* { dg-warning "too many consecutive spaces in leading whitespace" "" { target *-*-* } .-5 } */
34 /* { dg-warning "tab after space in leading whitespace" "" { target *-*-* } .-5 } */
35 /* { dg-warning "whitespace other than spaces and tabs in leading whitespace" "" { target *-*-* } .-5 } */
36 /* { dg-warning "whitespace other than spaces and tabs in leading whitespace" "" { target *-*-* } .-5 } */
37 /* { dg-warning "too many consecutive spaces in leading whitespace" "" { target *-*-* } .+1 } */
38 const char *p = R"*|*(
39 a
40 b
41 c
42 d
43 e
44 f
45 g
46 )*|*";
47 /* This is a comment with leading whitespace non-issues and issues
48 a
49 b
50 c
51 d
52 e
53 f
54 g
55 */
56 /* { dg-warning "too many consecutive spaces in leading whitespace" "" { target *-*-* } .-5 } */
57 /* { dg-warning "tab after space in leading whitespace" "" { target *-*-* } .-5 } */
58 /* { dg-warning "whitespace other than spaces and tabs in leading whitespace" "" { target *-*-* } .-5 } */
59 /* { dg-warning "whitespace other than spaces and tabs in leading whitespace" "" { target *-*-* } .-5 } */