OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [ssp-2.c] - Rev 298

Go to most recent revision | Compare with Previous | Blame | View Log

/* { dg-do run { target native } } */
/* { dg-options "-fstack-protector" } */
/* { dg-options "-fstack-protector -Wl,-multiply_defined,suppress" { target *-*-darwin* } } */
/* { dg-require-effective-target fstack_protector } */
 
#include <stdlib.h>
 
void
__stack_chk_fail (void)
{
  exit (0); /* pass */
}
 
void
overflow()
{
  int i = 0;
  char foo[30];
 
  /* Overflow buffer.  */
  for (i = 0; i < 50; i++)
      foo[i] = 42;
}
 
int main (void)
{
  overflow ();
  return 1; /* fail */
}
 

Go to most recent revision | Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.