diff options
author | hutchinsonandy <hutchinsonandy@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-09-08 22:41:27 +0000 |
---|---|---|
committer | hutchinsonandy <hutchinsonandy@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-09-08 22:41:27 +0000 |
commit | b16f2aba83e6d30098a0fa4b006d3d3e9d462069 (patch) | |
tree | f973e0244a11e9a84195c1a3871da73a7b5bafa2 /gcc | |
parent | f1bc4b8ef9d942882057523ac52bb85edde7b915 (diff) | |
download | gcc-b16f2aba83e6d30098a0fa4b006d3d3e9d462069.tar.gz |
* gcc.dg/struct/wo_prof_escape_substr_value.c: Limit allocation based on STACK_SIZE.
* gcc.dg/struct/wo_prof_array_through_pointer.c: Ditto.
* gcc.dg/struct/wo_prof_escape_substr_pointer.c: Ditto.
* gcc.dg/struct/wo_prof_escape_arg_to_local.c: Limit allocation based on STACK_SIZE. Check malloc return for NULL.
* gcc.dg/struct/w_prof_local_var.c: Ditto.
* gcc.dg/struct/wo_prof_mult_field_peeling.c: Ditto.
* gcc.dg/struct/w_prof_local_array.c: Limit allocation based on STACK_SIZE. XFAIL AVR target.
* gcc.dg/struct/wo_prof_local_array.c: Ditto.
* gcc.dg/struct/w_prof_two_strs.c: Limit allocation based on STACK_SIZE. Limit random size to N.
* gcc.dg/struct/wo_prof_two_strs.c: Limit allocation based on STACK_SIZE. XFAIL AVR target. Limit random size to N.
* gcc.dg/struct/w_prof_single_str_global.c: XFAIL AVR target.
* gcc.dg/struct/wo_prof_array_field.c: Ditto.
* gcc.dg/struct/wo_prof_double_malloc.c: Ditto.
* gcc.dg/struct/wo_prof_global_array.c: Ditto.
* gcc.dg/struct/wo_prof_single_str_global.c: Ditto.
* gcc.dg/struct/wo_prof_single_str_local.c: Ditto.
* gcc.dg/struct/w_prof_global_var.c: Limit allocation based on STACK_SIZE. Check malloc return for NULL. XFAIL AVR target.
* gcc.dg/struct/wo_prof_global_var.c: Ditto.
* gcc.dg/struct/wo_prof_local_var.c: Ditto.
* gcc.dg/struct/wo_prof_malloc_size_var.c: Access only allocated space. Limit allocation based on STACK_SIZE. XFAIL AVR target.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@140126 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
21 files changed, 175 insertions, 25 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 4a4afab0a5e..138351adc3f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,33 @@ +2008-09-08 Andy Hutchinson <hutchinsonandy@aim.com> + + * gcc.dg/struct/wo_prof_escape_substr_value.c: Limit allocation + based on STACK_SIZE. + * gcc.dg/struct/wo_prof_array_through_pointer.c: Ditto. + * gcc.dg/struct/wo_prof_escape_substr_pointer.c: Ditto. + * gcc.dg/struct/wo_prof_escape_arg_to_local.c: Limit allocation + based on STACK_SIZE. Check malloc return for NULL. + * gcc.dg/struct/w_prof_local_var.c: Ditto. + * gcc.dg/struct/wo_prof_mult_field_peeling.c: Ditto. + * gcc.dg/struct/w_prof_local_array.c: Limit allocation based on + STACK_SIZE. XFAIL AVR target. + * gcc.dg/struct/wo_prof_local_array.c: Ditto. + * gcc.dg/struct/w_prof_two_strs.c: Limit allocation based on + STACK_SIZE. Limit random size to N. + * gcc.dg/struct/wo_prof_two_strs.c: Limit allocation based on + STACK_SIZE. XFAIL AVR target. Limit random size to N. + * gcc.dg/struct/w_prof_single_str_global.c: XFAIL AVR target. + * gcc.dg/struct/wo_prof_array_field.c: Ditto. + * gcc.dg/struct/wo_prof_double_malloc.c: Ditto. + * gcc.dg/struct/wo_prof_global_array.c: Ditto. + * gcc.dg/struct/wo_prof_single_str_global.c: Ditto. + * gcc.dg/struct/wo_prof_single_str_local.c: Ditto. + * gcc.dg/struct/w_prof_global_var.c: Limit allocation based on + STACK_SIZE. Check malloc return for NULL. XFAIL AVR target. + * gcc.dg/struct/wo_prof_global_var.c: Ditto. + * gcc.dg/struct/wo_prof_local_var.c: Ditto. + * gcc.dg/struct/wo_prof_malloc_size_var.c: Access only allocated + space. Limit allocation based on STACK_SIZE. XFAIL AVR target. + 2008-09-08 John David Anglin <dave.anglin@nrc-cnrc.gc.ca> * g++.dg/cdce3.C: Require c99 runtime. diff --git a/gcc/testsuite/gcc.dg/struct/w_prof_global_var.c b/gcc/testsuite/gcc.dg/struct/w_prof_global_var.c index 8f1ae752fd3..c51648c4ef0 100644 --- a/gcc/testsuite/gcc.dg/struct/w_prof_global_var.c +++ b/gcc/testsuite/gcc.dg/struct/w_prof_global_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 str_t *p; @@ -15,7 +23,8 @@ main () int i, sum; p = malloc (N * sizeof (str_t)); - + if (p == NULL) + return 0; for (i = 0; i < N; i++) p[i].b = i; @@ -30,5 +39,5 @@ main () } /*--------------------------------------------------------------------------*/ -/* { dg-final-use { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" } } */ +/* { dg-final-use { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail { "avr-*-*" } } } } */ /* { dg-final-use { cleanup-ipa-dump "*" } } */ diff --git a/gcc/testsuite/gcc.dg/struct/w_prof_local_array.c b/gcc/testsuite/gcc.dg/struct/w_prof_local_array.c index 6394d07bf76..1a798e399d3 100644 --- a/gcc/testsuite/gcc.dg/struct/w_prof_local_array.c +++ b/gcc/testsuite/gcc.dg/struct/w_prof_local_array.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 () @@ -26,5 +34,5 @@ main () } /*--------------------------------------------------------------------------*/ -/* { dg-final-use { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" } } */ +/* { dg-final-use { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail { "avr-*-*" } } } } */ /* { dg-final-use { cleanup-ipa-dump "*" } } */ 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; diff --git a/gcc/testsuite/gcc.dg/struct/w_prof_single_str_global.c b/gcc/testsuite/gcc.dg/struct/w_prof_single_str_global.c index db9372e4c0e..6a717ddb23f 100644 --- a/gcc/testsuite/gcc.dg/struct/w_prof_single_str_global.c +++ b/gcc/testsuite/gcc.dg/struct/w_prof_single_str_global.c @@ -26,6 +26,6 @@ main () } /*--------------------------------------------------------------------------*/ -/* { dg-final-use { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" } } */ +/* { dg-final-use { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail { "avr-*-*" } } } } */ /* { dg-final-use { cleanup-ipa-dump "*" } } */ diff --git a/gcc/testsuite/gcc.dg/struct/w_prof_two_strs.c b/gcc/testsuite/gcc.dg/struct/w_prof_two_strs.c index aca646a1d34..308c30e4fd7 100644 --- a/gcc/testsuite/gcc.dg/struct/w_prof_two_strs.c +++ b/gcc/testsuite/gcc.dg/struct/w_prof_two_strs.c @@ -12,7 +12,15 @@ typedef struct float d; }str_t2; +#ifdef STACK_SIZE +#if STACK_SIZE > 16000 #define N 1000 +#else +#define N (STACK_SIZE/16) +#endif +#else +#define N 1000 +#endif str_t1 *p1; str_t2 *p2; @@ -33,7 +41,7 @@ main () int i, r; r = rand (); - num = r > N ? N : num; + num = r > N ? N : r; p1 = malloc (num * sizeof (str_t1)); p2 = malloc (num * sizeof (str_t2)); diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_array_field.c b/gcc/testsuite/gcc.dg/struct/wo_prof_array_field.c index 1c41de5bc3c..12c217aad97 100644 --- a/gcc/testsuite/gcc.dg/struct/wo_prof_array_field.c +++ b/gcc/testsuite/gcc.dg/struct/wo_prof_array_field.c @@ -23,5 +23,5 @@ int main() } /*--------------------------------------------------------------------------*/ -/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" } } */ +/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail { "avr-*-*" } } } } */ /* { dg-final { cleanup-ipa-dump "*" } } */ diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_array_through_pointer.c b/gcc/testsuite/gcc.dg/struct/wo_prof_array_through_pointer.c index 07460191ba0..303afb72b36 100644 --- a/gcc/testsuite/gcc.dg/struct/wo_prof_array_through_pointer.c +++ b/gcc/testsuite/gcc.dg/struct/wo_prof_array_through_pointer.c @@ -8,7 +8,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 () diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_double_malloc.c b/gcc/testsuite/gcc.dg/struct/wo_prof_double_malloc.c index 27503f82464..b1508eec5c7 100644 --- a/gcc/testsuite/gcc.dg/struct/wo_prof_double_malloc.c +++ b/gcc/testsuite/gcc.dg/struct/wo_prof_double_malloc.c @@ -26,5 +26,5 @@ int main() } /*--------------------------------------------------------------------------*/ -/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" } } */ +/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail { "avr-*-*" } } } } */ /* { dg-final { cleanup-ipa-dump "*" } } */ diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_escape_arg_to_local.c b/gcc/testsuite/gcc.dg/struct/wo_prof_escape_arg_to_local.c index b120a799cd6..43ca58b9ef2 100644 --- a/gcc/testsuite/gcc.dg/struct/wo_prof_escape_arg_to_local.c +++ b/gcc/testsuite/gcc.dg/struct/wo_prof_escape_arg_to_local.c @@ -9,7 +9,15 @@ struct str float b; }; +#ifdef STACK_SIZE +#if STACK_SIZE > 8000 #define N 1000 +#else +#define N (STACK_SIZE/8) +#endif +#else +#define N 1000 +#endif int foo (struct str * p_str) @@ -25,7 +33,8 @@ main () { int i, sum; struct str * p = malloc (N * sizeof (struct str)); - + if (p == NULL) + return 0; for (i = 0; i < N; i++) sum = foo (p+i); diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_escape_substr_pointer.c b/gcc/testsuite/gcc.dg/struct/wo_prof_escape_substr_pointer.c index fcb10e37b52..8e54632454e 100644 --- a/gcc/testsuite/gcc.dg/struct/wo_prof_escape_substr_pointer.c +++ b/gcc/testsuite/gcc.dg/struct/wo_prof_escape_substr_pointer.c @@ -8,7 +8,15 @@ typedef struct float b; }str_t; +#ifdef STACK_SIZE +#if STACK_SIZE > 16000 #define N 1000 +#else +#define N (STACK_SIZE/16) +#endif +#else +#define N 1000 +#endif typedef struct { diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_escape_substr_value.c b/gcc/testsuite/gcc.dg/struct/wo_prof_escape_substr_value.c index 49283a586f2..bade3153909 100644 --- a/gcc/testsuite/gcc.dg/struct/wo_prof_escape_substr_value.c +++ b/gcc/testsuite/gcc.dg/struct/wo_prof_escape_substr_value.c @@ -8,7 +8,16 @@ 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 + typedef struct { diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_global_array.c b/gcc/testsuite/gcc.dg/struct/wo_prof_global_array.c index 1254281f565..4ffd4b5a265 100644 --- a/gcc/testsuite/gcc.dg/struct/wo_prof_global_array.c +++ b/gcc/testsuite/gcc.dg/struct/wo_prof_global_array.c @@ -29,5 +29,5 @@ main () } /*--------------------------------------------------------------------------*/ -/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" } } */ +/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail { "avr-*-*" } } } } */ /* { dg-final { cleanup-ipa-dump "*" } } */ diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_global_var.c b/gcc/testsuite/gcc.dg/struct/wo_prof_global_var.c index a38dd58b021..58790bfd527 100644 --- a/gcc/testsuite/gcc.dg/struct/wo_prof_global_var.c +++ b/gcc/testsuite/gcc.dg/struct/wo_prof_global_var.c @@ -8,7 +8,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 str_t *p; @@ -18,7 +26,8 @@ main () int i, sum; p = malloc (N * sizeof (str_t)); - + if (p == NULL) + return 0; for (i = 0; i < N; i++) p[i].b = i; @@ -33,5 +42,5 @@ main () } /*--------------------------------------------------------------------------*/ -/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" } } */ +/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail { "avr-*-*" } } } } */ /* { dg-final { cleanup-ipa-dump "*" } } */ diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_local_array.c b/gcc/testsuite/gcc.dg/struct/wo_prof_local_array.c index 28d66e4cccf..3d92da40517 100644 --- a/gcc/testsuite/gcc.dg/struct/wo_prof_local_array.c +++ b/gcc/testsuite/gcc.dg/struct/wo_prof_local_array.c @@ -8,7 +8,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 () @@ -29,5 +37,5 @@ main () } /*--------------------------------------------------------------------------*/ -/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" } } */ +/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail { "avr-*-*" } } } } */ /* { dg-final { cleanup-ipa-dump "*" } } */ diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_local_var.c b/gcc/testsuite/gcc.dg/struct/wo_prof_local_var.c index 65b31978312..5a778a7d439 100644 --- a/gcc/testsuite/gcc.dg/struct/wo_prof_local_var.c +++ b/gcc/testsuite/gcc.dg/struct/wo_prof_local_var.c @@ -8,7 +8,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 () @@ -16,7 +24,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; @@ -31,5 +40,5 @@ main () } /*--------------------------------------------------------------------------*/ -/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" } } */ +/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail { "avr-*-*" } } } } */ /* { dg-final { cleanup-ipa-dump "*" } } */ diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_malloc_size_var.c b/gcc/testsuite/gcc.dg/struct/wo_prof_malloc_size_var.c index 7e80baba7d8..04b8b6621fb 100644 --- a/gcc/testsuite/gcc.dg/struct/wo_prof_malloc_size_var.c +++ b/gcc/testsuite/gcc.dg/struct/wo_prof_malloc_size_var.c @@ -8,26 +8,35 @@ 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 () { int i, num; - num = rand(); + num = rand(); + num = num > N ? N : num; str_t * p = malloc (num * sizeof (str_t)); if (p == 0) return 0; - for (i = 0; i < N; i++) + for (i = 0; i < num; i++) p[i].b = i; - for (i = 0; i < N; i++) + for (i = 0; i < num; i++) p[i].a = p[i].b + 1; - for (i = 0; i < N; i++) + for (i = 0; i < num; i++) if (p[i].a != p[i].b + 1) abort (); @@ -35,5 +44,5 @@ main () } /*--------------------------------------------------------------------------*/ -/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" } } */ +/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail { "avr-*-*" } } } } */ /* { dg-final { cleanup-ipa-dump "*" } } */ diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_mult_field_peeling.c b/gcc/testsuite/gcc.dg/struct/wo_prof_mult_field_peeling.c index df2b4ee08bd..8f116df4d01 100644 --- a/gcc/testsuite/gcc.dg/struct/wo_prof_mult_field_peeling.c +++ b/gcc/testsuite/gcc.dg/struct/wo_prof_mult_field_peeling.c @@ -10,14 +10,23 @@ typedef struct float d; }str_t; +#ifdef STACK_SIZE +#if STACK_SIZE > 1600 #define N 100 +#else +#define N (STACK_SIZE/16) +#endif +#else +#define N 100 +#endif int main () { int i; str_t *p = malloc (N * sizeof (str_t)); - + if (p == NULL) + return 0; for (i = 0; i < N; i++) p[i].a = 5; diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_single_str_global.c b/gcc/testsuite/gcc.dg/struct/wo_prof_single_str_global.c index 5569debfc0d..81c3edfa413 100644 --- a/gcc/testsuite/gcc.dg/struct/wo_prof_single_str_global.c +++ b/gcc/testsuite/gcc.dg/struct/wo_prof_single_str_global.c @@ -29,5 +29,5 @@ main () } /*--------------------------------------------------------------------------*/ -/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" } } */ +/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail { "avr-*-*" } } } } */ /* { dg-final { cleanup-ipa-dump "*" } } */ diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_single_str_local.c b/gcc/testsuite/gcc.dg/struct/wo_prof_single_str_local.c index 65a9602963a..f9cb7d58a5d 100644 --- a/gcc/testsuite/gcc.dg/struct/wo_prof_single_str_local.c +++ b/gcc/testsuite/gcc.dg/struct/wo_prof_single_str_local.c @@ -29,5 +29,5 @@ main () } /*--------------------------------------------------------------------------*/ -/* { dg-final { scan-ipa-dump "No structures to transform" "ipa_struct_reorg" } } */ +/* { dg-final { scan-ipa-dump "No structures to transform" "ipa_struct_reorg" { xfail { "avr-*-*" } } } } */ /* { dg-final { cleanup-ipa-dump "*" } } */ diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_two_strs.c b/gcc/testsuite/gcc.dg/struct/wo_prof_two_strs.c index 5fb152a1420..24dae559829 100644 --- a/gcc/testsuite/gcc.dg/struct/wo_prof_two_strs.c +++ b/gcc/testsuite/gcc.dg/struct/wo_prof_two_strs.c @@ -15,7 +15,15 @@ typedef struct float d; }str_t2; +#ifdef STACK_SIZE +#if STACK_SIZE > 16000 #define N 1000 +#else +#define N (STACK_SIZE/16) +#endif +#else +#define N 1000 +#endif str_t1 *p1; str_t2 *p2; @@ -36,7 +44,7 @@ main () int i, r; r = rand (); - num = r > N ? N : num; + num = r > N ? N : r; p1 = malloc (num * sizeof (str_t1)); p2 = malloc (num * sizeof (str_t2)); @@ -56,5 +64,5 @@ main () } /*--------------------------------------------------------------------------*/ -/* { dg-final { scan-ipa-dump "Number of structures to transform is 2" "ipa_struct_reorg" } } */ +/* { dg-final { scan-ipa-dump "Number of structures to transform is 2" "ipa_struct_reorg" { xfail { "avr-*-*" } } } } */ /* { dg-final { cleanup-ipa-dump "*" } } */ |