diff options
author | Erick Ochoa <erick.ochoa@theobroma-systems.com> | 2020-06-18 17:20:37 +0200 |
---|---|---|
committer | Erick Ochoa <erick.ochoa@theobroma-systems.com> | 2020-06-18 19:21:41 +0200 |
commit | c82c07726da2ed895875090bc8be91fc0704b733 (patch) | |
tree | 443c7480cf7ecef59a1fe798056d497913ff92b4 /gcc/testsuite/gcc.dg/ipa/ipa-structreorg-48-function-ptr-0.c | |
parent | 06e71a7c2b914b3dba71c3c1032d58abb3f52046 (diff) |
deleting writes to field
Diffstat (limited to 'gcc/testsuite/gcc.dg/ipa/ipa-structreorg-48-function-ptr-0.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/ipa/ipa-structreorg-48-function-ptr-0.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-48-function-ptr-0.c b/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-48-function-ptr-0.c index 2e55ad41d34..8b9f3e67501 100644 --- a/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-48-function-ptr-0.c +++ b/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-48-function-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=nextout -fipa-typelist-struct=arc " } */ +/* { dg-options "-flto -fipa-type-escape-analysis -fdump-ipa-type-escape-analysis " } */ #include <assert.h> #include <stddef.h> +#include <stdio.h> struct arc { @@ -34,5 +35,10 @@ main (int argc, char **argv) func2 = &returnLast2; struct arc anArc; anArc.c = argc; - assert (func1 (anArc) == func2 (anArc)); + printf("%d %d", anArc.a, anArc.c); + // These test means that things remain equal + // A.k.a without an optimization. + // Why? Because a function pointer can be a + // pointer to anything + assert (func1 (anArc) != func2 (anArc)); } |