1 /* { dg-do run } */
2
3 extern int memcmp (const void *, const void *, __SIZE_TYPE__);
4 extern void abort (void);
5
6 void __attribute__ ((noinline))
f(long * s,long * t,int len1,int len2)7 f (long *s, long *t, int len1, int len2)
8 {
9 int i, j;
10
11 j = 2;
12 for (i = len1 - 1; i >= 0; i--)
13 {
14 s[j--] = (i < len2 ? t[i] : t[len2 - 1] < 0 ? -1 : 0);
15 if (j < 0)
16 break;
17 }
18 }
19
20 long s[3];
21 long t[3];
22
23 int
main(void)24 main (void)
25 {
26 t[0] = 1;
27 t[1] = 2;
28 t[2] = 3;
29 f (s, t, 3, 3);
30 if (memcmp (s, t, sizeof (s)) != 0)
31 abort ();
32 return 0;
33 }
34
35