OSDN Git Service

PR tree-optimization/40542
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / vect / pr33846.c
1 /* Testcase by Martin Michlmayr <tbm@cyrius.com> */
2 /* { dg-do compile } */
3 /* { dg-require-effective-target vect_shift } */
4
5 int clamp_val (int i)
6 {
7   return ~i >> 31;
8 }
9
10 void _mix_some_samples (long buf, int *mix_buffer, int mix_size)
11 {
12   int i;
13   signed int *p = mix_buffer;
14   for (i = mix_size ; i > 0; i--)
15   {
16     *((short *) buf) = clamp_val ((*p) + 0x800000);
17     buf += 2;
18     p++;
19   }
20 }
21
22 /* { dg-final { cleanup-tree-dump "vect" } } */