| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O0 -Wno-compare-distinct-pointer-types" } */ |
| 3 |
|
| 4 |
typedef __INT32_TYPE__ __u32; |
| 5 |
|
| 6 |
struct xdp_md |
| 7 |
{ |
| 8 |
char *data; |
| 9 |
char *data_meta; |
| 10 |
}; |
| 11 |
|
| 12 |
int xdp_context (struct xdp_md *xdp) |
| 13 |
{ |
| 14 |
void *data = (void *)(__INTPTR_TYPE__)xdp->data; |
| 15 |
__u32 *metadata = (void *)(__INTPTR_TYPE__)xdp->data_meta; |
| 16 |
__u32 ret; |
| 17 |
|
| 18 |
if (metadata + 1 > data) /* There shouldn't be a warning here. */ |
| 19 |
return 1; |
| 20 |
if (metadata + 1 >= data) /* There shouldn't be a warning here. */ |
| 21 |
return 2; |
| 22 |
if (metadata + 1 < data) /* There shouldn't be a warning here. */ |
| 23 |
return 3; |
| 24 |
if (metadata + 1 <= data) /* There shouldn't be a warning here. */ |
| 25 |
return 4; |
| 26 |
if (metadata + 1 == data) /* There shouldn't be a warning here. */ |
| 27 |
return 5; |
| 28 |
if (metadata + 1 != data) /* There shouldn't be a warning here. */ |
| 29 |
return 5; |
| 30 |
|
| 31 |
return 1; |
| 32 |
} |