gcc/testsuite/gdc.dg/ubsan/pr88957.d
raw| 1 | // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88957 |
| 2 | // { dg-additional-options "-mavx" { target avx_runtime } } |
| 3 | // { dg-do compile { target { avx_runtime || vect_sizes_16B_8B } } } |
| 4 | // { dg-additional-options "-fsanitize=undefined" } |
| 5 | |
| 6 | alias int4 = __vector(int[4]); |
| 7 | |
| 8 | int fn(const int[4] x) |
| 9 | { |
| 10 | int sum = 0; |
| 11 | foreach (i; x) sum += i; |
| 12 | return sum; |
| 13 | } |
| 14 | |
| 15 | void pr88957() |
| 16 | { |
| 17 | auto x = fn(int4.init.array); |
| 18 | auto y = fn(int4(2).array); |
| 19 | } |