PR target/83368
[official-gcc.git] / gcc / testsuite / gcc.dg / pr37561.c
blobe73beccfea4a3bcb8527271388fb19b8c7f28e72
1 /* PR c++/37561 */
2 /* { dg-do compile } */
4 __extension__ __INTPTR_TYPE__ p;
5 char q;
7 void
8 foo ()
10 ((char *) p)++; /* { dg-error "lvalue" } */
12 ((char *) q)++; /* { dg-error "lvalue" } */
13 /* { dg-warning "cast to pointer from integer of different size" "" { target *-*-* } .-1 } */
15 ((char *) p)--; /* { dg-error "lvalue" } */
17 ((char *) q)--; /* { dg-error "lvalue" } */
18 /* { dg-warning "cast to pointer from integer of different size" "" { target *-*-* } .-1 } */
20 ++(char *) p; /* { dg-error "lvalue" } */
22 ++(char *) q; /* { dg-error "lvalue" } */
23 /* { dg-warning "cast to pointer from integer of different size" "" { target *-*-* } .-1 } */
25 --(char *) p; /* { dg-error "lvalue" } */
27 --(char *) q; /* { dg-error "lvalue" } */
28 /* { dg-warning "cast to pointer from integer of different size" "" { target *-*-* } .-1 } */