gcc/testsuite/gdc.dg/torture/simd19632.d
raw| 1 | // https://issues.dlang.org/show_bug.cgi?id=19632 |
| 2 | // { dg-additional-options "-mavx" { target avx_runtime } } |
| 3 | // { dg-do run { target { avx_runtime || vect_sizes_16B_8B } } } |
| 4 | // { dg-skip-if "needs gcc/config.d" { ! d_runtime } } |
| 5 | import core.simd; |
| 6 | |
| 7 | void main() |
| 8 | { |
| 9 | int4 v = [1, 2, 3, 4]; |
| 10 | int sum = 0; |
| 11 | foreach (ref e; v) |
| 12 | sum += (e *= 2); |
| 13 | assert(v.array[] == [2, 4, 6, 8]); |
| 14 | assert(sum == 20); |
| 15 | } |