gcc/testsuite/gdc.dg/torture/simd19223.d
raw| 1 | // https://issues.dlang.org/show_bug.cgi?id=19223 |
| 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 | int test19223a(const int[4] x) |
| 8 | { |
| 9 | int sum = 0; |
| 10 | foreach (i; x) sum += i; |
| 11 | return sum; |
| 12 | } |
| 13 | |
| 14 | void main() |
| 15 | { |
| 16 | int4 v1 = int4.init; |
| 17 | assert(test19223a(v1.array) == 0); |
| 18 | assert(test19223a(int4.init.array) == 0); |
| 19 | } |