gcc/testsuite/gcc.dg/vect/pr34195.c
raw| 1 | /* { dg-do compile } */ |
| 2 | /* { dg-require-effective-target vect_float } */ |
| 3 | |
| 4 | #define M 11 |
| 5 | |
| 6 | struct S |
| 7 | { |
| 8 | float x; |
| 9 | float y; |
| 10 | } pS[100]; |
| 11 | |
| 12 | float a[1000]; |
| 13 | float b[1000]; |
| 14 | |
| 15 | void |
| 16 | foo (int n) |
| 17 | { |
| 18 | int i, j; |
| 19 | |
| 20 | for (i = 0; i < n; i++) |
| 21 | { |
| 22 | pS[i].x = 0; |
| 23 | pS[i].y = 0; |
| 24 | |
| 25 | for (j = 0; j < M; j++) |
| 26 | { |
| 27 | pS[i].x += (a[i]+b[i]); |
| 28 | pS[i].y += (a[i]-b[i]); |
| 29 | } |
| 30 | } |
| 31 | } |
| 32 | |
| 33 | /* { dg-final { scan-tree-dump "OUTER LOOP VECTORIZED" "vect" } } */ |