]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
testsuite: add testcase for recent alias fix
authorSam James <sam@gentoo.org>
Tue, 25 Mar 2025 07:47:27 +0000 (07:47 +0000)
committerSam James <sam@gentoo.org>
Wed, 26 Mar 2025 06:02:47 +0000 (06:02 +0000)
r15-7961-gdc47161c1f32c3 fixes a typo in ao_compare::compare_ao_refs
but there wasn't a testcase available at the time. Now there is.

Thanks to Andrew for the testcase.

gcc/testsuite/ChangeLog:
PR testsuite/119382

* gcc.dg/ipa/ipa-icf-40.c: New test.

Co-authored-by: Andrew Pinski <quic_apinski@quicinc.com>
gcc/testsuite/gcc.dg/ipa/ipa-icf-40.c [new file with mode: 0644]

diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-icf-40.c b/gcc/testsuite/gcc.dg/ipa/ipa-icf-40.c
new file mode 100644 (file)
index 0000000..ab328ba
--- /dev/null
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-ipa-icf-optimized" } */
+
+int c0 = 0;
+typedef int v4si __attribute__((vector_size(4*sizeof(int))));
+v4si a;
+int f()
+{
+        return a[c0];
+}
+int g()
+{
+        return a[c0];
+}
+
+/* { dg-final { scan-ipa-dump "optimized: Semantic equality hit:f/\[0-9+\]+->g/\[0-9+\]+" "icf" } } */