2017-09-26 Thomas Koenig <tkoenig@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gcc.dg / misc-column.c
blobe68300bfc2901da21279520a8323e568257a9bd2
1 /* { dg-options "-fshow-column -Wall -Wfloat-equal -pedantic" } */
3 int i, j;
4 float a, b;
6 int *p;
7 struct {
8 int a;
9 char b;
10 } *q;
12 extern void bar();
14 void foo (void)
16 if (a == b) /* { dg-warning "9:comparing floating point with" } */
17 bar ();
19 if (p < q) /* { dg-warning "9:comparison of distinct pointer types" } */
20 bar ();
22 if (&p == 0) /* { dg-warning "10:comparison will always evaluate as 'false'" } */
23 bar();
25 if (p == 4) /* { dg-warning "9:comparison between pointer and integer" } */
26 bar();
28 if (p < 0) /* { dg-warning "9:ordered comparison of pointer with" } */
29 bar();
31 -q; /* { dg-error "3:wrong type argument to unary" } */
33 ~q; /* { dg-error "3:wrong type argument to bit" } */
35 ++*q; /* { dg-error "3:wrong type argument to increment" } */
37 i = j / 0; /* { dg-warning "9:division by zero" } */
39 i /= 0; /* { dg-warning "5:division by zero" } */