1 /* Test comparisons of pointers to complete and incomplete types are
2 diagnosed in C99 mode: -pedantic. */
3 /* { dg-do compile } */
4 /* { dg-options "-std=c99 -pedantic" } */
5
6 int
f(int (* p)[],int (* q)[3])7 f (int (*p)[], int (*q)[3])
8 {
9 return p < q; /* { dg-warning "complete and incomplete" } */
10 }
11
12 int
f2(int (* p)[],int (* q)[3])13 f2 (int (*p)[], int (*q)[3])
14 {
15 return p <= q; /* { dg-warning "complete and incomplete" } */
16 }
17
18 int
f3(int (* p)[],int (* q)[3])19 f3 (int (*p)[], int (*q)[3])
20 {
21 return p > q; /* { dg-warning "complete and incomplete" } */
22 }
23
24 int
f4(int (* p)[],int (* q)[3])25 f4 (int (*p)[], int (*q)[3])
26 {
27 return p >= q; /* { dg-warning "complete and incomplete" } */
28 }
29
30 int
g(int (* p)[],int (* q)[3])31 g (int (*p)[], int (*q)[3])
32 {
33 return q < p; /* { dg-warning "complete and incomplete" } */
34 }
35
36 int
g2(int (* p)[],int (* q)[3])37 g2 (int (*p)[], int (*q)[3])
38 {
39 return q <= p; /* { dg-warning "complete and incomplete" } */
40 }
41
42 int
g3(int (* p)[],int (* q)[3])43 g3 (int (*p)[], int (*q)[3])
44 {
45 return q > p; /* { dg-warning "complete and incomplete" } */
46 }
47
48 int
g4(int (* p)[],int (* q)[3])49 g4 (int (*p)[], int (*q)[3])
50 {
51 return q >= p; /* { dg-warning "complete and incomplete" } */
52 }
53