Debian Codegraph @

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

raw
1 /* { dg-do compile { target { c || c++11 } } } */
2 /* { dg-options "-Wleading-whitespace=spaces" } */
3
4 int i1; /* 4 spaces ok for */
5 int i2; /* 2 tabs 7 spaces not ok */
6 /* { dg-warning "whitespace other than spaces in leading whitespace" "" { target *-*-* } .-1 } */
7 int i3; /* 8 spaces ok */
8 int i4; /* tab 8 spaces not ok */
9 /* { dg-warning "whitespace other than spaces in leading whitespace" "" { target *-*-* } .-1 } */
10 int i5; /* 4 spaces tab not ok */
11 /* { dg-warning "whitespace other than spaces in leading whitespace" "" { target *-*-* } .-1 } */
12 int i6; /* space tab not ok */
13 /* { dg-warning "whitespace other than spaces in leading whitespace" "" { target *-*-* } .-1 } */
14 int i7; /* tab vtab not ok */
15 /* { dg-warning "whitespace other than spaces in leading whitespace" "" { target *-*-* } .-1 } */
16 int i8; /* tab form-feed not ok */
17 /* { dg-warning "whitespace other than spaces in leading whitespace" "" { target *-*-* } .-1 } */
18 int i9; /* 4 spaces vtab not ok */
19 /* { dg-warning "whitespace other than spaces in leading whitespace" "" { target *-*-* } .-1 } */
20 int i10; /* 2 spaces form-feed not ok */
21 /* { dg-warning "whitespace other than spaces 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 "whitespace other than spaces in leading whitespace" "" { target *-*-* } .-7 } */
33 /* { dg-warning "whitespace other than spaces in leading whitespace" "" { target *-*-* } .-6 } */
34 /* { dg-warning "whitespace other than spaces in leading whitespace" "" { target *-*-* } .-5 } */
35 /* { dg-warning "whitespace other than spaces in leading whitespace" "" { target *-*-* } .-5 } */
36 /* { dg-warning "whitespace other than spaces in leading whitespace" "" { target *-*-* } .-5 } */
37 const char *p = R"*|*(
38 a
39 b
40 c
41 d
42 e
43 f
44 g
45 )*|*";
46 /* This is a comment with leading whitespace non-issues and issues
47 a
48 b
49 c
50 d
51 e
52 f
53 g
54 */
55 /* { dg-warning "whitespace other than spaces in leading whitespace" "" { target *-*-* } .-8 } */
56 /* { dg-warning "whitespace other than spaces in leading whitespace" "" { target *-*-* } .-7 } */
57 /* { dg-warning "whitespace other than spaces in leading whitespace" "" { target *-*-* } .-7 } */
58 /* { dg-warning "whitespace other than spaces in leading whitespace" "" { target *-*-* } .-7 } */
59 /* { dg-warning "whitespace other than spaces in leading whitespace" "" { target *-*-* } .-7 } */
60 /* { dg-warning "whitespace other than spaces in leading whitespace" "" { target *-*-* } .-7 } */