| 1 |
/* PR target/31507 */ |
| 2 |
/* { dg-do run } */ |
| 3 |
/* { dg-options "-Os -fno-omit-frame-pointer" } */ |
| 4 |
|
| 5 |
extern void abort (void); |
| 6 |
|
| 7 |
__attribute__((noinline)) void |
| 8 |
foo (double d0, double d1, double d2, double d3, |
| 9 |
double d4, double d5, double d6, double d7, |
| 10 |
float f0, float f1, float f2, float f3, |
| 11 |
char *p) |
| 12 |
{ |
| 13 |
if (d0 != 0 || d1 != 1 || d2 != 2 || d3 != 3) |
| 14 |
abort (); |
| 15 |
if (d4 != 4 || d5 != 5 || d6 != 6 || d7 != 7) |
| 16 |
abort (); |
| 17 |
if (f0 != 10 || f1 != 11 || f2 != 12 || f3 != 13) |
| 18 |
abort (); |
| 19 |
if (__builtin_memcmp (p, "foo", 4) != 0) |
| 20 |
abort (); |
| 21 |
__builtin_memcpy (p, "bar", 4); |
| 22 |
} |
| 23 |
|
| 24 |
__attribute__((noinline)) void |
| 25 |
bar (int x) |
| 26 |
{ |
| 27 |
char p[x]; |
| 28 |
if (x >= sizeof "foo") |
| 29 |
__builtin_memcpy (p, "foo", 4); |
| 30 |
foo (0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, |
| 31 |
10.0f, 11.0f, 12.0f, 13.0f, p); |
| 32 |
if (x >= sizeof "bar" && __builtin_memcmp (p, "bar", 4) != 0) |
| 33 |
abort (); |
| 34 |
} |
| 35 |
|
| 36 |
int |
| 37 |
main (void) |
| 38 |
{ |
| 39 |
bar (128); |
| 40 |
return 0; |
| 41 |
} |