summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr32450.c
blob: 9606e3021eabcccfd988df43e29a028a434d00cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/* Contributed by Joost VandeVondele  <jv244@cam.ac.uk> */

/* { dg-do run } */
/* { dg-require-profiling "-pg" } */
/* { dg-options "-O2 -pg" } */
/* { dg-options "-O2 -pg -mtune=core2" { target { i?86-*-* x86_64-*-* } } } */
/* { dg-options "-O2 -pg -static" { target hppa*-*-hpux* } } */

extern void abort (void);

int stack_pointer;

void
__attribute__((noinline))
mystop ()
{
  abort ();
}

void
__attribute__((noinline))
add ()
{
  if (stack_pointer + 1 > 10)
    mystop ();

  stack_pointer = stack_pointer + 1;
}

int main ()
{
  add ();
  return stack_pointer - 1;
}

/* { dg-final { cleanup-profile-file } } */