summaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common/ubsan/pr80349.c
blob: eb2e3da0721e7c465db5930246cd1e2c00752c20 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/* PR sanitizer/80349 */
/* { dg-do compile } */
/* { dg-options "-fsanitize=undefined" } */

int var;
long a;

long
fn1 ()
{
  return 0 % ((a & 1) == (7UL & 1));
}

long
fn2 ()
{
  return 0 % ((a & 1) == (1 & 7UL));
}

long
fn3 ()
{
  return 0 % ((1 & a) == (7UL & 1));
}

long
fn4 ()
{
  return 0 % ((1 & a) == (1 & 7UL));
}