]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/gcc.dg/memchr-3.c
Update copyright years.
[thirdparty/gcc.git] / gcc / testsuite / gcc.dg / memchr-3.c
CommitLineData
aec2d684
MS
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" } */
5
6typedef __INT8_TYPE__ int8_t;
7typedef __INT32_TYPE__ int32_t;
8
9extern void* memchr (const void*, int, long);
10
11struct SX
12{
13 int32_t n;
14 int8_t a[];
15};
16
17const struct SX sx = { 0x1221 };
18const char sx_rep[] = { };
19
20void test_find (void)
21{
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);
25}