view gcc/testsuite/c-c++-common/ubsan/const-expr-1.c @ 152:2b5abeee2509

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents 04ced10e8804
children
line wrap: on
line source

/* { dg-do compile } */
/* { dg-options "-fsanitize=shift -w" } */

enum e { A = 1 << 1, B, };
const int arr[] = {
  1 << 2,
  1 << 3,
};

int
bar (int a, int b)
{
  return a >> b;
}

int
foo (void)
{
  int i = 1;
  int vla[B << 3];
  return bar (A, (i <<= 6, i + 2));
}