diff options
author | Erick Ochoa <erick.ochoa@theobroma-systems.com> | 2020-03-09 11:58:09 +0100 |
---|---|---|
committer | Erick Ochoa <erick.ochoa@theobroma-systems.com> | 2020-04-28 23:35:47 +0200 |
commit | 0505d8724fb62f09ecc70518f3ad90a1071d49bb (patch) | |
tree | 2535778d8e2456776dd2ecf7cf03898fda1f61d0 | |
parent | 321656d2e65842b927ebe9662c6dd132e46927e4 (diff) |
Fixes tests
-rw-r--r-- | gcc/testsuite/gcc.dg/ipa/ipa-ea-05-global-escapes-0.c | 16 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/ipa/ipa-ea-06-global-type-escapes-0.c | 21 |
2 files changed, 30 insertions, 7 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 98f43df25e8..cc1c46fc0eb 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,12 +1,14 @@ /* { dg-do link } */ -/* { dg-options "-flto -fipa-hello-world -fdump-ipa-hello-world" } */ +/* { dg-options "-flto -fipa-hello-world -fdump-ipa-hello-world" } */ +/* { dg-require-effective-target lto } */ + #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 bstruct_s { _Bool a; _Bool b; _Bool c;}; +struct bstruct_s bstruct; // This should not escape int main() { @@ -15,7 +17,7 @@ int main() } -/* { 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" } } */ +/* { dg-final { scan-wpa-ipa-dump "collected,astruct_s" "hello-world" } } */ +/* { dg-final { scan-wpa-ipa-dump "variable bstruct is escaping false" "hello-world" } } */ +/* { dg-final { scan-wpa-ipa-dump "collected,bstruct_s" "hello-world" } } */ +/* { dg-final { scan-wpa-ipa-dump "variable astruct is escaping true" "hello-world" } } */ diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-ea-06-global-type-escapes-0.c b/gcc/testsuite/gcc.dg/ipa/ipa-ea-06-global-type-escapes-0.c new file mode 100644 index 00000000000..4debd92e061 --- /dev/null +++ b/gcc/testsuite/gcc.dg/ipa/ipa-ea-06-global-type-escapes-0.c @@ -0,0 +1,21 @@ +/* { dg-do link } */ +/* { 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 bstruct_s { _Bool a; _Bool b; _Bool c;}; +struct bstruct_s bstruct; // This should not escape + +int main() +{ + astruct.a = 0; + bstruct.b = 0; +} + + +/* { dg-final { scan-wpa-ipa-dump "collected,astruct_s" "hello-world" } } */ +/* { dg-final { scan-wpa-ipa-dump "type astruct_s is escaping true" "hello-world" } } */ +/* { dg-final { scan-wpa-ipa-dump "collected,bstruct_s" "hello-world" } } */ +/* { dg-final { scan-wpa-ipa-dump "type bstruct_s is escaping false" "hello-world" } } */ |