summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/ipa/pr50605.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/ipa/pr50605.C')
-rw-r--r--gcc/testsuite/g++.dg/ipa/pr50605.C40
1 files changed, 40 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/ipa/pr50605.C b/gcc/testsuite/g++.dg/ipa/pr50605.C
new file mode 100644
index 00000000000..4910a37f8f2
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ipa/pr50605.C
@@ -0,0 +1,40 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -fno-early-inlining" } */
+
+class A
+{
+public:
+ int a;
+ void *stuff;
+};
+
+class B
+{
+public:
+ int b;
+ void *other_stuff;
+ A array[50];
+};
+
+extern B gb;
+
+int process_A (A *a)
+{
+ return a->a;
+}
+
+int process_A_complex (A *a)
+{
+ return process_A (a+3);
+}
+
+int process_B (B *b)
+{
+ return process_A_complex (&b->array[0]);
+}
+
+int foo (void)
+{
+ return process_B (&gb);
+}
+