summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/ipa
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/ipa')
-rw-r--r--gcc/testsuite/gcc.dg/ipa/ipa-sra-6.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-sra-6.c b/gcc/testsuite/gcc.dg/ipa/ipa-sra-6.c
new file mode 100644
index 00000000000..c9a766d9e8f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/ipa/ipa-sra-6.c
@@ -0,0 +1,32 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fipa-sra -fdump-tree-eipa_sra-slim" } */
+
+struct bovid
+{
+ float a;
+ int b;
+ struct bovid *next;
+};
+
+static int
+__attribute__((noinline))
+foo (struct bovid *cow, int i)
+{
+ i++;
+ if (cow->next)
+ foo (cow->next, i);
+ return i;
+}
+
+int main (int argc, char *argv[])
+{
+ struct bovid cow;
+
+ cow.a = 7.4;
+ cow.b = 6;
+ cow.next = (struct bovid *) 0;
+
+ return foo (&cow, 0);
+}
+
+/* { dg-final { scan-tree-dump-times "foo " 1 "eipa_sra" } } */