| 1 |
/* { dg-do run } */ |
| 2 |
/* { dg-require-effective-target arm_neon_hw } */ |
| 3 |
/* { dg-options "-fno-omit-frame-pointer -mapcs-frame -O" } |
| 4 |
/* { dg-add-options arm_neon } */ |
| 5 |
|
| 6 |
extern void abort (void); |
| 7 |
|
| 8 |
float data; |
| 9 |
|
| 10 |
void __attribute__((noinline, noclone)) bar (float f) |
| 11 |
{ |
| 12 |
data = f; |
| 13 |
} |
| 14 |
|
| 15 |
float __attribute__((noinline, noclone)) foo (float f) |
| 16 |
{ |
| 17 |
int error_reported = 0; |
| 18 |
|
| 19 |
void __attribute__((noinline, noclone)) |
| 20 |
nested (int a, int b, int c, int d, float f0, float f1, float f2, float f3) |
| 21 |
{ |
| 22 |
float e; |
| 23 |
|
| 24 |
if (f3 > f2) |
| 25 |
e = f3; |
| 26 |
else |
| 27 |
e = f2; |
| 28 |
|
| 29 |
if (f0 - f1 > e) |
| 30 |
{ |
| 31 |
error_reported = a + b + c + d; |
| 32 |
bar (f0); |
| 33 |
bar (e); |
| 34 |
} |
| 35 |
} |
| 36 |
|
| 37 |
nested (1, 2, 3, 4, 1.0, 1.0, 3.5, 4.2); |
| 38 |
return f + (float)error_reported; |
| 39 |
} |
| 40 |
|
| 41 |
#define PI 3.1415927f |
| 42 |
|
| 43 |
int main (void) |
| 44 |
{ |
| 45 |
if (foo (PI) != PI) |
| 46 |
abort (); |
| 47 |
return 0; |
| 48 |
} |