Debian Codegraph @

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

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