gcc/testsuite/gcc.dg/vect/fast-math-vect-reduc-9.c
raw| 1 | /* { dg-additional-options "-ffast-math" } */ |
| 2 | /* { dg-require-effective-target vect_float } */ |
| 3 | |
| 4 | #include "tree-vect.h" |
| 5 | |
| 6 | float x[1024]; |
| 7 | float |
| 8 | test (void) |
| 9 | { |
| 10 | int i; |
| 11 | float gosa = 0.0; |
| 12 | for (i = 0; i < 1024; ++i) |
| 13 | { |
| 14 | float tem = x[i]; |
| 15 | gosa += tem * tem; |
| 16 | } |
| 17 | return gosa; |
| 18 | } |
| 19 | |
| 20 | int main (void) |
| 21 | { |
| 22 | check_vect (); |
| 23 | |
| 24 | if (test () != 0.0) |
| 25 | abort (); |
| 26 | |
| 27 | return 0; |
| 28 | } |
| 29 | |
| 30 | /* { dg-final { scan-tree-dump "vectorized 1 loops" "vect" } } */ |