summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-40-typedef-0.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/ipa/ipa-structreorg-40-typedef-0.c')
-rw-r--r--gcc/testsuite/gcc.dg/ipa/ipa-structreorg-40-typedef-0.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-40-typedef-0.c b/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-40-typedef-0.c
new file mode 100644
index 00000000000..01ee28f0f1a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-40-typedef-0.c
@@ -0,0 +1,22 @@
+/* { dg-do run } */
+/* { dg-options "-flto -fipa-type-escape-analysis -fdump-ipa-type-escape-analysis " } */
+
+#include <stdio.h>
+
+int
+main ()
+{
+ struct astruct_s
+ {
+ _Bool a;
+ _Bool b;
+ _Bool c;
+ };
+ typedef struct astruct_s astruct_s;
+ astruct_s astruct;
+ printf ("%d %d", astruct.a, astruct.c);
+ return 0;
+}
+
+/* { dg-final { scan-ipa-dump "replacing field a 0 with a 0" "type-escape-analysis" } } */
+/* { dg-final { scan-ipa-dump "replacing field c 16 with c 8" "type-escape-analysis" } } */