Skip analyzer strndup test on hppa*-*-hpux*
[official-gcc.git] / gcc / testsuite / gcc.dg / memchr-3.c
blob9c73265a89ee2e20bbfe762aabaa769aa3e116b1
1 /* PR middle-end/97956 - ICE due to type mismatch in pointer_plus_expr
2 during memchr folding
3 { dg-do compile }
4 { dg-options "-O2 -Wall" } */
6 typedef __INT8_TYPE__ int8_t;
7 typedef __INT32_TYPE__ int32_t;
9 extern void* memchr (const void*, int, long); /* { dg-warning "-Wbuiltin-declaration-mismatch" "" { target llp64 } } */
11 struct SX
13 int32_t n;
14 int8_t a[];
17 const struct SX sx = { 0x1221 };
18 const char sx_rep[] = { };
20 void test_find (void)
22 int n = 0, nb = (const char*)&sx.a - (const char*)&sx;
23 const char *p = (const char*)&sx, *q = sx_rep;
24 n += p + 1 == memchr (p, q[1], nb);