summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/struct/w_prof_local_var.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/struct/w_prof_local_var.c')
-rw-r--r--gcc/testsuite/gcc.dg/struct/w_prof_local_var.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/gcc/testsuite/gcc.dg/struct/w_prof_local_var.c b/gcc/testsuite/gcc.dg/struct/w_prof_local_var.c
index c84863c3790..82f24a1a4b1 100644
--- a/gcc/testsuite/gcc.dg/struct/w_prof_local_var.c
+++ b/gcc/testsuite/gcc.dg/struct/w_prof_local_var.c
@@ -5,7 +5,15 @@ typedef struct
float b;
}str_t;
+#ifdef STACK_SIZE
+#if STACK_SIZE > 8000
#define N 1000
+#else
+#define N (STACK_SIZE/8)
+#endif
+#else
+#define N 1000
+#endif
int
main ()
@@ -13,7 +21,8 @@ main ()
int i, sum;
str_t * p = malloc (N * sizeof (str_t));
-
+ if (p == NULL)
+ return 0;
for (i = 0; i < N; i++)
p[i].b = i;