view gcc/testsuite/gcc.c-torture/execute/memset-4.c @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
line wrap: on
line source

/* Test to make sure memset of small old size works
   correctly. */
#define SIZE 15

void f(char *a) __attribute__((noinline));
void f(char *a)
{
  __builtin_memset (a, 0, SIZE);
}


int main(void)
{
  int i;
  char b[SIZE];
  for(i = 0; i < sizeof(b); i++)
    {
      b[i] = i;
    }
  f(b);
  for(i = 0; i < sizeof(b); i++)
    {
      if (0 != b[i])
	__builtin_abort ();
    }
  return 0;
}