view gcc/testsuite/g++.dg/opt/pr78901.C @ 152:2b5abeee2509

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

// PR middle-end/78901
// { dg-do compile }
// { dg-options "-O2 -Wno-stringop-overflow" }

extern "C" int __snprintf_chk (char *, __SIZE_TYPE__, int, __SIZE_TYPE__, const char *, ...);

int
foo (char *c)
{
  try
    {
      return __snprintf_chk (c, 64, 0, 32, "%s", "abcdefghijklmnopq");
    }
  catch (...)
    {
      return -1;
    }
}