| 1 |
/* { dg-do run } */ |
| 2 |
/* { dg-require-effective-target aarch64_variant_pcs } */ |
| 3 |
/* { dg-additional-options "-std=c99" } */ |
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
/* There is nothing special about the calculations here, this is just |
| 8 |
a test that can be compiled and run. */ |
| 9 |
|
| 10 |
extern void abort (void); |
| 11 |
|
| 12 |
__Float64x2_t __attribute__ ((noinline, aarch64_vector_pcs)) |
| 13 |
foo(__Float64x2_t a, __Float64x2_t b, __Float64x2_t c, |
| 14 |
__Float64x2_t d, __Float64x2_t e, __Float64x2_t f, |
| 15 |
__Float64x2_t g, __Float64x2_t h, __Float64x2_t i) |
| 16 |
{ |
| 17 |
__Float64x2_t w, x, y, z; |
| 18 |
w = a + b * c; |
| 19 |
x = d + e * f; |
| 20 |
y = g + h * i; |
| 21 |
return w + x * y; |
| 22 |
} |
| 23 |
|
| 24 |
|
| 25 |
int main() |
| 26 |
{ |
| 27 |
__Float64x2_t a, b, c, d; |
| 28 |
a = (__Float64x2_t) { 1.0, 2.0 }; |
| 29 |
b = (__Float64x2_t) { 3.0, 4.0 }; |
| 30 |
c = (__Float64x2_t) { 5.0, 6.0 }; |
| 31 |
d = foo (a, b, c, (a+b), (b+c), (a+c), (a-b), (b-c), (a-c)) + a + b + c; |
| 32 |
if (d[0] != 337.0 || d[1] != 554.0) |
| 33 |
abort (); |
| 34 |
return 0; |
| 35 |
} |