aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common/cpp/Wleading-whitespace-2.c
blob: 9def4967a37b0620cf19647dd7c0cecc277f6e37 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/* { dg-do compile { target { c || c++11 } } } */
/* { dg-options "-Wleading-whitespace=spaces" } */

    int i1; /* 4 spaces ok for */
		       int i2; /* 2 tabs 7 spaces not ok */
/* { dg-warning "whitespace other than spaces in leading whitespace" "" { target *-*-* } .-1 } */
        int i3; /* 8 spaces ok */
	        int i4; /* tab 8 spaces not ok */
/* { dg-warning "whitespace other than spaces in leading whitespace" "" { target *-*-* } .-1 } */
    	int i5; /* 4 spaces tab not ok */
/* { dg-warning "whitespace other than spaces in leading whitespace" "" { target *-*-* } .-1 } */
 	int i6; /* space tab not ok */
/* { dg-warning "whitespace other than spaces in leading whitespace" "" { target *-*-* } .-1 } */
	 int i7; /* tab vtab not ok */
/* { dg-warning "whitespace other than spaces in leading whitespace" "" { target *-*-* } .-1 } */
	 int i8; /* tab form-feed not ok */
/* { dg-warning "whitespace other than spaces in leading whitespace" "" { target *-*-* } .-1 } */
     int i9; /* 4 spaces vtab not ok */
/* { dg-warning "whitespace other than spaces in leading whitespace" "" { target *-*-* } .-1 } */
   int i10; /* 2 spaces form-feed not ok */
/* { dg-warning "whitespace other than spaces in leading whitespace" "" { target *-*-* } .-1 } */
	        	
/* Just whitespace on a line is something for -Wtrailing-whitespace.  */
int \
	i11, \
    i12, \
		        i13, \
        i14, \
 	i15, \
		i16, \
		i17;
/* { dg-warning "whitespace other than spaces in leading whitespace" "" { target *-*-* } .-7 } */
/* { dg-warning "whitespace other than spaces in leading whitespace" "" { target *-*-* } .-6 } */
/* { dg-warning "whitespace other than spaces in leading whitespace" "" { target *-*-* } .-5 } */
/* { dg-warning "whitespace other than spaces in leading whitespace" "" { target *-*-* } .-5 } */
/* { dg-warning "whitespace other than spaces in leading whitespace" "" { target *-*-* } .-5 } */
          const char *p = R"*|*(		
    a
	b
	    c
          d
 	e
		 f
  g
)*|*";
/* This is a comment with leading whitespace non-issues and issues
		a
      b
	    c
	        d
 	e
	 f
	 g
*/
/* { dg-warning "whitespace other than spaces in leading whitespace" "" { target *-*-* } .-8 } */
/* { dg-warning "whitespace other than spaces in leading whitespace" "" { target *-*-* } .-7 } */
/* { dg-warning "whitespace other than spaces in leading whitespace" "" { target *-*-* } .-7 } */
/* { dg-warning "whitespace other than spaces in leading whitespace" "" { target *-*-* } .-7 } */
/* { dg-warning "whitespace other than spaces in leading whitespace" "" { target *-*-* } .-7 } */
/* { dg-warning "whitespace other than spaces in leading whitespace" "" { target *-*-* } .-7 } */