diff options
author | Erick Ochoa <erick.ochoa@theobroma-systems.com> | 2020-03-06 16:56:18 +0100 |
---|---|---|
committer | Erick Ochoa <erick.ochoa@theobroma-systems.com> | 2020-04-28 23:35:47 +0200 |
commit | 321656d2e65842b927ebe9662c6dd132e46927e4 (patch) | |
tree | bbd0d4b2967f3c1191ea2cea02979f40e8072a95 | |
parent | fe76ed63da5a7be985b4cfc6e7760506cd35c232 (diff) |
Fixes test
-rw-r--r-- | gcc/testsuite/gcc.dg/ipa/ipa-ea-05-global-escapes-0.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-ea-05-global-escapes-0.c b/gcc/testsuite/gcc.dg/ipa/ipa-ea-05-global-escapes-0.c index 961c961e9f3..98f43df25e8 100644 --- a/gcc/testsuite/gcc.dg/ipa/ipa-ea-05-global-escapes-0.c +++ b/gcc/testsuite/gcc.dg/ipa/ipa-ea-05-global-escapes-0.c @@ -1,13 +1,21 @@ /* { dg-do link } */ -/* { dg-options "-c -fipa-hello-world -fdump-ipa-hello-world" } */ +/* { dg-options "-flto -fipa-hello-world -fdump-ipa-hello-world" } */ #include <stddef.h> struct astruct_s { _Bool a; _Bool b; _Bool c;}; +__attribute__((externally_visible)) struct astruct_s astruct; // This should escape +struct astruct_b { _Bool a; _Bool b; _Bool c;}; +struct astruct_b bstruct; // This should not escape -struct astruct_s astruct; +int main() +{ + astruct.a = 0; + bstruct.b = 0; +} /* { dg-final { scan-ipa-dump "collected,astruct_s" "hello-world" } } */ -/* { dg-final { scan-ipa-dump "collected,astruct_s*" "hello-world" } } */ -/* { dg-final { scan-ipa-dump "collected,astruct_s[]" "hello-world" } } */ +/* { dg-final { scan-ipa-dump "variable bstruct is escaping false" "hello-world" } } */ +/* { dg-final { scan-ipa-dump "collected,bstruct_s" "hello-world" } } */ +/* { dg-final { scan-ipa-dump "variable astruct is escaping true" "hello-world" } } */ |