PR middle-end/85602 - -Wsizeof-pointer-memaccess for strncat with size of source
[official-gcc.git] / gcc / testsuite / gcc.dg / pr83363.c
blobe69826890f5fd2acba254737280a9fbf78aa850e
1 /* PR rtl-optimization/83363 */
2 /* { dg-do run } */
3 /* { dg-options "-O2 -fno-forward-propagate" } */
5 unsigned char a;
6 unsigned int b;
8 static unsigned short __attribute__ ((noinline, noclone))
9 foo (unsigned short x)
11 x -= b;
12 x <<= x == 0;
13 a = ~0;
14 a >>= (unsigned char) x == 0;
15 x *= a -= ~a;
16 return x;
19 int
20 main ()
22 asm volatile ("" : : : "memory");
23 if (foo (3) != (unsigned short) (3 * (unsigned char) ~0))
24 __builtin_abort ();
25 return 0;