Warn pointer to signed integer cast for ilp32
[official-gcc.git] / gcc / testsuite / gcc.dg / pr35258.c
blobd1c45a79dc7405488559fc15cb9394753ec70aba
1 /* { dg-do run } */
2 /* { dg-options "-O1" } */
4 extern void *memcpy (void *, const void *, __SIZE_TYPE__);
5 extern int memcmp (const void *, const void *, __SIZE_TYPE__);
6 extern void abort(void);
8 char str[9] = "1234";
10 void
11 bar (void)
13 unsigned int temp;
14 char *p = &str[2];
16 memcpy (&temp, &str[1], 4);
17 memcpy (p, &temp, 4);
18 str[1] = '.';
21 int main()
23 bar();
24 if (memcmp (str, "1.234", 5) != 0)
25 abort ();
27 return 0;