aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/c-c++-common/ubsan/save-expr-4.c
blob: aa34a70ede70dd7e895cc3061bbe798a990460b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* { dg-do compile } */
/* { dg-options "-fsanitize=shift -Wall -Werror -O" } */

int x;

int
foo (int i, unsigned int u)
{
  return (i % u) << (x / u);
}

int
bar (int i, unsigned int u)
{
  return (((x % u) << (u / i)) >> x);
}