aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common/ubsan/pr85213.c
blob: e903e976f2c3254e32efcece9c5532d47ef15c29 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/* PR sanitizer/85213 */
/* { dg-do compile } */
/* Pass -gno-statement-frontiers to work around
   https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100733 :
   without it the IR coming from the front end may be different with and without
   debug information turned on. That may cause e.g., different discriminator values
   and -fcompare-debug failures. */
/* { dg-options "-O1 -fsanitize=undefined -fcompare-debug -gno-statement-frontiers" } */

int
foo (int x)
{
  return (__builtin_expect (({ x != 0; }) ? 0 : 1, 3) == 0) * -1 << 0;
}