summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-12-delete-last-field-0.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/ipa/ipa-structreorg-12-delete-last-field-0.c')
-rw-r--r--gcc/testsuite/gcc.dg/ipa/ipa-structreorg-12-delete-last-field-0.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-12-delete-last-field-0.c b/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-12-delete-last-field-0.c
new file mode 100644
index 00000000000..5183e632228
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-12-delete-last-field-0.c
@@ -0,0 +1,23 @@
+/* { dg-do run } */
+/* { dg-options "-flto -fipa-type-escape-analysis -fdump-ipa-type-escape-analysis" } */
+
+#include <assert.h>
+
+int
+main ()
+{
+ struct astruct_s
+ {
+ _Bool a;
+ _Bool c;
+ _Bool b;
+ };
+ struct astruct_s b[2];
+ _Bool *first_of_second = &(b[1].a);
+ _Bool *c_0 = &(b[0].c);
+ _Bool *a_1 = &(b[1].a);
+ _Bool *a_1_from_c_0 = c_0 + 1;
+ _Bool test = a_1_from_c_0 == a_1;
+ char compile_test[test ? 1 : -1];
+ assert (test);
+}