diff options
author | Erick Ochoa <erick.ochoa@theobroma-systems.com> | 2020-06-17 13:09:26 +0200 |
---|---|---|
committer | Erick Ochoa <erick.ochoa@theobroma-systems.com> | 2020-06-17 13:10:07 +0200 |
commit | 2096c9d2a40a138e5d388d06b1c04839ac1fb91f (patch) | |
tree | 2b30283d5a7cc0b82b4f0138c729ec94a241381e | |
parent | c91c8ab11faa895584fdb3776acf45f02011c7b4 (diff) |
fixes teset
9 files changed, 39 insertions, 27 deletions
diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-11-rewrites-minus-expr-0.c b/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-11-rewrites-minus-expr-0.c index 448db9759ef..2501da43b64 100644 --- a/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-11-rewrites-minus-expr-0.c +++ b/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-11-rewrites-minus-expr-0.c @@ -1,5 +1,5 @@ /* { dg-do run } */ -/* { dg-options "-flto -flto-partition=none -fipa-dead-field-eliminate -fdump-ipa-structure-reorg -fipa-typelist-field=b -fipa-typelist-struct=astruct_s" } */ +/* { dg-options "-flto -fipa-type-escape-analysis -fdump-ipa-type-escape-analysis" } */ #include <assert.h> #include <stddef.h> diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-12-delete-last-field-0.c b/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-12-delete-last-field-0.c index dd14c66f600..5183e632228 100644 --- a/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-12-delete-last-field-0.c +++ b/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-12-delete-last-field-0.c @@ -1,5 +1,5 @@ /* { dg-do run } */ -/* { dg-options "-flto -flto-partition=none -fipa-dead-field-eliminate -fdump-ipa-structure-reorg -fipa-typelist-field=b -fipa-typelist-struct=astruct_s" } */ +/* { dg-options "-flto -fipa-type-escape-analysis -fdump-ipa-type-escape-analysis" } */ #include <assert.h> diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-13-modify-size-four-0.c b/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-13-modify-size-four-0.c index df1b546906c..911e9cba242 100644 --- a/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-13-modify-size-four-0.c +++ b/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-13-modify-size-four-0.c @@ -1,5 +1,5 @@ /* { dg-do run } */ -/* { dg-options "-flto -flto-partition=none -fipa-dead-field-eliminate -fdump-ipa-structure-reorg -fipa-typelist-field=b -fipa-typelist-struct=astruct_s" } */ +/* { dg-options "-flto -fipa-type-escape-analysis -fdump-ipa-type-escape-analysis" } */ #include <assert.h> #include <stddef.h> diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-14-rewrite-plus-expr-0.c b/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-14-rewrite-plus-expr-0.c index e458b14c820..f752d36c22f 100644 --- a/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-14-rewrite-plus-expr-0.c +++ b/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-14-rewrite-plus-expr-0.c @@ -1,5 +1,5 @@ /* { dg-do run } */ -/* { dg-options "-flto -flto-partition=none -fipa-dead-field-eliminate -fdump-ipa-structure-reorg -fipa-typelist-field=b -fipa-typelist-struct=astruct_s" } */ +/* { dg-options "-flto -fipa-type-escape-analysis -fdump-ipa-type-escape-analysis" } */ #include <assert.h> #include <stddef.h> @@ -14,9 +14,12 @@ main () _Bool c; }; struct astruct_s astruct; - int d = astruct.c + 1; + astruct.a = 1; + astruct.c = 1; + int d = astruct.a + astruct.c; + assert(d == 2); _Bool *a = &(astruct.a); - _Bool *c = a + 1; - assert (*c == 1); + _Bool *c = &(astruct.c); + assert(a + 1 == c); return 0; } diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-15-rewrite-mult-expr-0.c b/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-15-rewrite-mult-expr-0.c index 2f7ab7d8927..63182416316 100644 --- a/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-15-rewrite-mult-expr-0.c +++ b/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-15-rewrite-mult-expr-0.c @@ -1,5 +1,5 @@ /* { dg-do run } */ -/* { dg-options "-flto -flto-partition=none -fipa-dead-field-eliminate -fdump-ipa-structure-reorg -fipa-typelist-field=b -fipa-typelist-struct=astruct_s" } */ +/* { dg-options "-flto -fipa-type-escape-analysis -fdump-ipa-type-escape-analysis" } */ #include <stddef.h> #include <assert.h> @@ -14,9 +14,12 @@ main () _Bool c; }; struct astruct_s astruct; - int d = astruct.c * 2; + astruct.a = 1; + astruct.c = 1; + int d = astruct.a * astruct.c; + assert(d == 1); _Bool *a = &(astruct.a); - _Bool *c = a + 1; - assert (*c == 0); + _Bool *c = &(astruct.c); + assert (a + 1 == c); return 0; } diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-16-rewrite-field-reads-ptr-0.c b/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-16-rewrite-field-reads-ptr-0.c index 3c4b7b08dd1..21a0a5c202c 100644 --- a/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-16-rewrite-field-reads-ptr-0.c +++ b/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-16-rewrite-field-reads-ptr-0.c @@ -1,8 +1,9 @@ /* { dg-do run } */ -/* { dg-options "-flto -flto-partition=none -fipa-dead-field-eliminate -fdump-ipa-structure-reorg -fipa-typelist-field=b -fipa-typelist-struct=astruct_s" } */ +/* { dg-options "-flto -fipa-type-escape-analysis -fdump-ipa-type-escape-analysis" } */ #include <assert.h> #include <stddef.h> +#include <stdio.h> int main () @@ -14,11 +15,10 @@ main () _Bool c; }; struct astruct_s astruct; - astruct.c = 1; struct astruct_s *astruct_p = &astruct; - _Bool c = astruct_p->c; + printf("%d %d\n", astruct_p->a, astruct_p->c); _Bool *a = &(astruct.a); - _Bool *c_ptr = a + 1; - assert (*c_ptr == c); + _Bool *c = &(astruct.c); + assert (a + 1 == c); return 0; } diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-17-rewrite-field-write-ptr-0.c b/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-17-rewrite-field-write-ptr-0.c index f297eea6aa0..a2d6f830654 100644 --- a/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-17-rewrite-field-write-ptr-0.c +++ b/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-17-rewrite-field-write-ptr-0.c @@ -1,5 +1,5 @@ /* { dg-do run } */ -/* { dg-options "-flto -flto-partition=none -fipa-dead-field-eliminate -fdump-ipa-structure-reorg -fipa-typelist-field=b -fipa-typelist-struct=astruct_s" } */ +/* { dg-options "-flto -fipa-type-escape-analysis -fdump-ipa-type-escape-analysis" } */ #include <assert.h> diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-18-field-writes-deref-0.c b/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-18-field-writes-deref-0.c index bc204f4017f..f395f721ba8 100644 --- a/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-18-field-writes-deref-0.c +++ b/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-18-field-writes-deref-0.c @@ -1,12 +1,13 @@ /* { dg-do run } */ -/* { dg-options "-flto -flto-partition=none -fipa-dead-field-eliminate -fdump-ipa-structure-reorg -fipa-typelist-field=b -fipa-typelist-struct=astruct_s" } */ +/* { dg-options "-flto -fipa-type-escape-analysis -fdump-ipa-type-escape-analysis" } */ + +#include <assert.h> int main () { struct astruct_s { - _Bool e; _Bool a; _Bool b; _Bool c; @@ -14,9 +15,12 @@ main () }; struct astruct_s astruct; _Bool *c_ptr = &astruct.c; - c_ptr--; *c_ptr = 1; - _Bool *e_ptr = &astruct.e; - e_ptr++; - return *e_ptr - 1; + _Bool *a_ptr = &astruct.a; + _Bool *d_ptr = &astruct.d; + a_ptr++; + d_ptr--; + assert(*a_ptr == 1); + assert(*d_ptr == 1); + return 0; } diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-19-middle-pointer-equal-0.c b/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-19-middle-pointer-equal-0.c index 10f850bb801..c537788eef4 100644 --- a/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-19-middle-pointer-equal-0.c +++ b/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-19-middle-pointer-equal-0.c @@ -1,5 +1,5 @@ /* { dg-do run } */ -/* { dg-options "-flto -flto-partition=none -fipa-dead-field-eliminate -fdump-ipa-structure-reorg -fipa-typelist-field=b -fipa-typelist-struct=astruct_s" } */ +/* { dg-options "-flto -fipa-type-escape-analysis -fdump-ipa-type-escape-analysis" } */ #include <assert.h> @@ -16,9 +16,11 @@ main () struct astruct_s astruct; _Bool *a = &astruct.a; _Bool *d = &astruct.d; + _Bool *c = &astruct.c; _Bool *c_from_a = a + 1; _Bool *c_from_d = d - 1; - _Bool test = c_from_a == c_from_d; - char compile_test[test ? 1 : -1]; - assert (test); + assert(c == c_from_a); + assert(c == c_from_d); + assert(c_from_a == c_from_d); + return 0; } |