diff options
author | Erick Ochoa <erick.ochoa@theobroma-systems.com> | 2020-06-18 12:55:47 +0200 |
---|---|---|
committer | Erick Ochoa <erick.ochoa@theobroma-systems.com> | 2020-06-18 19:21:40 +0200 |
commit | 28f7c5935fcdf371223bf0ad62d8ee26e32f205d (patch) | |
tree | a6c49343f37192f6a79e2d3ab623bd68d5b53dfc | |
parent | 3a3a5ef9b009db9c18cfd3034ef54ce8659d47d3 (diff) |
everything good until memref
-rw-r--r-- | gcc/testsuite/gcc.dg/ipa/ipa-structreorg-39-typedef-0.c | 8 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/ipa/ipa-structreorg-40-typedef-0.c | 8 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/ipa/ipa-structreorg-41-deref-0.c | 14 |
3 files changed, 27 insertions, 3 deletions
diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-39-typedef-0.c b/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-39-typedef-0.c index c8f0569e932..7b228d4b64c 100644 --- a/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-39-typedef-0.c +++ b/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-39-typedef-0.c @@ -1,5 +1,7 @@ /* { 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 <stdio.h> int main () @@ -11,5 +13,9 @@ main () _Bool c; } astruct_s; astruct_s astruct; + printf("%d %d", astruct.a, astruct.c); return 0; } + +/* { dg-final { scan-ipa-dump "replacing field a 0 with a 0" "type-escape-analysis" } } */ +/* { dg-final { scan-ipa-dump "replacing field c 16 with c 8" "type-escape-analysis" } } */ diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-40-typedef-0.c b/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-40-typedef-0.c index d1f752ff005..4bc98ab66a3 100644 --- a/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-40-typedef-0.c +++ b/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-40-typedef-0.c @@ -1,5 +1,7 @@ /* { 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 <stdio.h> int main () @@ -12,5 +14,9 @@ main () }; typedef struct astruct_s astruct_s; astruct_s astruct; + printf("%d %d", astruct.a, astruct.c); return 0; } + +/* { dg-final { scan-ipa-dump "replacing field a 0 with a 0" "type-escape-analysis" } } */ +/* { dg-final { scan-ipa-dump "replacing field c 16 with c 8" "type-escape-analysis" } } */ diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-41-deref-0.c b/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-41-deref-0.c index a0c8d4a1f3e..b4b3518e1b9 100644 --- a/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-41-deref-0.c +++ b/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-41-deref-0.c @@ -1,5 +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 <stdio.h> +#include <assert.h> +#include <stdbool.h> int main () @@ -13,6 +17,14 @@ main () struct astruct_s astruct; struct astruct_s *t, copy; t = &astruct; + t->a = true; + t->c = true; copy = *t; + printf("%d %d", copy.a, copy.c); + assert(astruct.a == true); + assert(astruct.c == true); return 0; } + +/* { dg-final { scan-ipa-dump "replacing field a 0 with a 0" "type-escape-analysis" } } */ +/* { dg-final { scan-ipa-dump "replacing field c 16 with c 8" "type-escape-analysis" } } */ |