gcc/testsuite/gcc.dg/torture/pr118662.c
raw| 1 | /* { dg-do run } */ |
| 2 | /* { dg-additional-options "-ftree-slp-vectorize -fno-vect-cost-model" } */ |
| 3 | /* { dg-additional-options "-msse4" { target sse4_runtime} } */ |
| 4 | |
| 5 | int __attribute__((noipa)) addup(signed char *num) { |
| 6 | int val = num[0] + num[1] + num[2] + num[3]; |
| 7 | if (num[3] >= 0) |
| 8 | val++; |
| 9 | return val; |
| 10 | } |
| 11 | |
| 12 | int main(int, char *[]) |
| 13 | { |
| 14 | signed char num[4] = {1, 1, 1, -1}; |
| 15 | if (addup(num) != 2) |
| 16 | __builtin_abort(); |
| 17 | return 0; |
| 18 | } |