1 /* PR optimization/8634 */
2 /* Contributed by Glen Nakamura <glen at imodulo dot com> */
4 extern void abort (void);
7 char a
, b
, c
, d
, e
, f
, g
, h
, i
, j
;
12 const char X
[8] = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H' };
14 __builtin_memcpy (buffer
, X
, 8);
15 if (buffer
[0] != 'A' || buffer
[1] != 'B'
16 || buffer
[2] != 'C' || buffer
[3] != 'D'
17 || buffer
[4] != 'E' || buffer
[5] != 'F'
18 || buffer
[6] != 'G' || buffer
[7] != 'H')
25 const char X
[10] = { 'A', 'B', 'C', 'D', 'E' };
27 __builtin_memcpy (buffer
, X
, 10);
28 if (buffer
[0] != 'A' || buffer
[1] != 'B'
29 || buffer
[2] != 'C' || buffer
[3] != 'D'
30 || buffer
[4] != 'E' || buffer
[5] != '\0'
31 || buffer
[6] != '\0' || buffer
[7] != '\0'
32 || buffer
[8] != '\0' || buffer
[9] != '\0')
39 const struct foo X
= { a
: 'A', c
: 'C', e
: 'E', g
: 'G', i
: 'I' };
41 __builtin_memcpy (buffer
, &X
, 10);
42 if (buffer
[0] != 'A' || buffer
[1] != '\0'
43 || buffer
[2] != 'C' || buffer
[3] != '\0'
44 || buffer
[4] != 'E' || buffer
[5] != '\0'
45 || buffer
[6] != 'G' || buffer
[7] != '\0'
46 || buffer
[8] != 'I' || buffer
[9] != '\0')
53 const struct foo X
= { .b
= 'B', .d
= 'D', .f
= 'F', .h
= 'H' , .j
= 'J' };
55 __builtin_memcpy (buffer
, &X
, 10);
56 if (buffer
[0] != '\0' || buffer
[1] != 'B'
57 || buffer
[2] != '\0' || buffer
[3] != 'D'
58 || buffer
[4] != '\0' || buffer
[5] != 'F'
59 || buffer
[6] != '\0' || buffer
[7] != 'H'
60 || buffer
[8] != '\0' || buffer
[9] != 'J')
67 test1 (); test2 (); test3 (); test4 ();