gcc/testsuite/gdc.dg/torture/simd19607.d
raw| 1 | // https://issues.dlang.org/show_bug.cgi?id=19607 |
| 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 test19607a(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 = 1; |
| 17 | assert(test19607a(v1.array) == 4); |
| 18 | assert(test19607a(int4(2).array) == 8); |
| 19 | } |