aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/ssp-1.c
blob: c839a5d3ae23efc1d7313dbee5c5aa553a326bcd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* { dg-do run { target native } } */
/* { dg-options "-fstack-protector" } */
#include <stdlib.h>

static void
__stack_chk_fail (void)
{
  exit (0); /* pass */
}

int main ()
{
  int i;
  char foo[255];

  // smash stack
  for (i = 0; i <= 400; i++)
    foo[i] = 42;

  return 1; /* fail */
}