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

#include <stdio.h>

static int x;
int
main (void)
{
  fputs ("UBSAN TEST START\n", stderr);

  int o = 1;
  int y = x << o;

  fputs ("UBSAN TEST END\n", stderr);
  return y;
}

/* { dg-output "UBSAN TEST START(\n|\r\n|\r)UBSAN TEST END" } */