1 /* { dg-do run } */
2 /* { dg-options "-O1" } */
3
4 extern void *memcpy (void *, const void *, __SIZE_TYPE__);
5 extern int memcmp (const void *, const void *, __SIZE_TYPE__);
6 extern void abort(void);
7
8 char str[9] = "1234";
9
10 void
bar(void)11 bar (void)
12 {
13 #if __SIZEOF_INT__ >= 4
14 unsigned int temp;
15 #else
16 __UINT32_TYPE__ temp;
17 #endif
18 char *p = &str[2];
19
20 memcpy (&temp, &str[1], 4);
21 memcpy (p, &temp, 4);
22 str[1] = '.';
23 }
24
main()25 int main()
26 {
27 bar();
28 if (memcmp (str, "1.234", 5) != 0)
29 abort ();
30
31 return 0;
32 }
33