summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/lto/pr60461_0.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/lto/pr60461_0.c')
-rw-r--r--gcc/testsuite/gcc.dg/lto/pr60461_0.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/lto/pr60461_0.c b/gcc/testsuite/gcc.dg/lto/pr60461_0.c
new file mode 100644
index 0000000000..cad6a8de85
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/pr60461_0.c
@@ -0,0 +1,37 @@
+/* { dg-lto-do link } */
+/* { dg-lto-options {{-Os -flto} } } */
+
+
+struct S
+{
+ int f1;
+ int f2;
+} a[1] = { {0, 0} };
+
+int b, c;
+
+static unsigned short fn1 (struct S);
+
+void
+fn2 ()
+{
+ for (; c;)
+ ;
+ b = 0;
+ fn1 (a[0]);
+}
+
+unsigned short
+fn1 (struct S p)
+{
+ if (p.f1)
+ fn2 ();
+ return 0;
+}
+
+int
+main ()
+{
+ fn2 ();
+ return 0;
+}