view gcc/testsuite/gcc.dg/20050309-1.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
line wrap: on
line source

/* This caused an ICE on s390 due to incorrect secondary
   output reloads.  */

/* { dg-do compile } */
/* { dg-require-profiling "-fprofile-generate" } */
/* { dg-options "-O2 -fprofile-generate" } */

void lookup ();
int hash ();
void error ();

char *
test(char *ret, int *counter, void *schema,
     const char* name, const char *namespace,
     void *node, int topLevel)
{
  char buf[30];
  int val;

  if (counter == 0) return 0;
  if (schema == 0) return 0;
  if (name == 0) return 0;

  __builtin_memset (ret, 0, 100);
  lookup (schema, name, -1);
  val = hash (schema, name, namespace, name, ret);
  if (val == 0) return ret;

  if (topLevel != 0)
    {
      error (1, 0, 0, node, "%s", name);
      return 0;
    }

  __snprintf_chk (buf, 29, 1, 30, "#eCont %d", ++*counter);
  val = hash (schema, name, buf, namespace, ret);
  if (val == 0) return ret;

  error (1, 0, 0, node, "%s", name);
  return 0;
}