match: Optimize `max(a,b) == 0` to `(a|b) == 0` for unsigned [PR115275]
[official-gcc.git] / gcc / testsuite / gcc.dg / pr85467.c
blobfad94fcd83ee03ef80e822888bf1f5227582eda4
1 /* PR tree-optimization/85467 */
2 /* { dg-do compile } */
3 /* { dg-options "-O2 -fno-tree-ccp" } */
5 #define TEST(N, T) \
6 typedef T V##N __attribute__ ((__vector_size__ (sizeof (T)))); \
8 V##N \
9 bar##N (V##N u, V##N v) \
10 { \
11 do \
12 v *= (T)((V##N){}[0] ? u[v[0]] : 0); \
13 while ((V##N){}[0]); \
14 return v; \
15 } \
17 void \
18 foo##N (void) \
19 { \
20 bar##N ((V##N){}, (V##N){}); \
23 TEST (1, char)
24 TEST (2, short)
25 TEST (3, int)
26 TEST (4, long)
27 TEST (5, long long)
28 #ifdef __SIZEOF_INT128__
29 TEST (6, __int128)
30 #endif