libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / pr113281-3.c
blob5982dd2d16fb1498bb65a43e9359d6359bcf4980
1 /* { dg-do compile } */
3 #define N 128
5 short x[N];
6 short y[N];
8 void
9 f1 (void)
11 for (int i = 0; i < N; ++i)
12 x[i] >>= (y[i] < 30 ? y[i] : 30);
15 void
16 f2 (void)
18 for (int i = 0; i < N; ++i)
19 x[i] >>= ((y[i] & 15) + 2);
22 void
23 f3 (void)
25 for (int i = 0; i < N; ++i)
26 x[i] >>= (y[i] < 16 ? y[i] : 16);
29 void
30 f4 (void)
32 for (int i = 0; i < N; ++i)
33 x[i] = 32768 >> ((y[i] & 15) + 3);
36 /* { dg-final { scan-tree-dump {can narrow to signed:31 without loss [^\n]+>>} "vect" } } */
37 /* { dg-final { scan-tree-dump {can narrow to signed:18 without loss [^\n]+>>} "vect" } } */
38 /* { dg-final { scan-tree-dump {can narrow to signed:17 without loss [^\n]+>>} "vect" } } */
39 /* { dg-final { scan-tree-dump {can narrow to unsigned:19 without loss [^\n]+>>} "vect" } } */