summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/lto/ipacp_0.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/lto/ipacp_0.c')
-rw-r--r--gcc/testsuite/gcc.dg/lto/ipacp_0.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/lto/ipacp_0.c b/gcc/testsuite/gcc.dg/lto/ipacp_0.c
new file mode 100644
index 000000000..097c1c253
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/ipacp_0.c
@@ -0,0 +1,15 @@
+/* { dg-lto-options {{ -O1 -flto -flto-partition=1to1 -fipa-cp -fipa-cp-clone}} } */
+/* { dg-lto-do run } */
+
+/* Test that clonning happens and we unify declarations of a from both units. */
+const int a = 5;
+extern void clone_me (int *);
+
+int
+main(void)
+{
+ int i;
+ for (i=0;i<100;i++)
+ clone_me ((int *)&a);
+ return 0;
+}