summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr32450.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/pr32450.c')
-rw-r--r--gcc/testsuite/gcc.dg/pr32450.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/pr32450.c b/gcc/testsuite/gcc.dg/pr32450.c
new file mode 100644
index 000000000..9606e3021
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr32450.c
@@ -0,0 +1,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 } } */