summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg
diff options
context:
space:
mode:
authorErick Ochoa <erick.ochoa@theobroma-systems.com>2020-02-07 22:39:44 +0100
committerErick Ochoa <erick.ochoa@theobroma-systems.com>2020-04-28 23:35:34 +0200
commitba0a2936608400bbb20791338b4495fea3b234a4 (patch)
treeeeaa4fe51f5722753641a760bd4c7762223b4ede /gcc/testsuite/gcc.dg
parentcb5596fbd824174f514934e0dacdf85d60d44597 (diff)
add test for static variables
Diffstat (limited to 'gcc/testsuite/gcc.dg')
-rw-r--r--gcc/testsuite/gcc.dg/ipa/ipa-structreorg-46-static-0.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-46-static-0.c b/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-46-static-0.c
new file mode 100644
index 00000000000..960241b5d6a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-46-static-0.c
@@ -0,0 +1,20 @@
+/* { dg-do run } */
+/* { dg-options "-flto -flto-partition=none -fipa-dead-field-eliminate -fdump-ipa-structure-reorg -fipa-typelist-field=nextout -fipa-typelist-struct=arc" } */
+
+#include <assert.h>
+#include <stddef.h>
+
+struct arc { _Bool a; _Bool nextout; _Bool c;};
+
+struct arc an_arc;
+
+int main() {
+
+ _Bool *a = &(an_arc.a);
+ _Bool *c = &(an_arc.c);
+ ptrdiff_t diff = c - a;
+ assert(diff == 1);
+
+
+}
+