summaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorErick Ochoa <erick.ochoa@theobroma-systems.com>2020-03-09 11:58:09 +0100
committerErick Ochoa <erick.ochoa@theobroma-systems.com>2020-06-03 16:05:17 +0200
commit69413fe7d41574fdc8648479c205e5e6153f1369 (patch)
treef22f789ba30d0c93f2e668a70a2f487a7f803007 /gcc/testsuite
parent4832bfb4f972ad462db1a14a9d310797b353fe4d (diff)
Fixes tests
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/gcc.dg/ipa/ipa-ea-05-global-escapes-0.c16
-rw-r--r--gcc/testsuite/gcc.dg/ipa/ipa-ea-06-global-type-escapes-0.c21
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" } } */