aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2025-03-25 07:47:27 +0000
committerSam James <sam@gentoo.org>2025-03-26 06:02:47 +0000
commit4cac3f83c2b31ab352f537368e4efdadd5c47a9a (patch)
tree38d588b82a8d99486bce2a4b7bc90f3c7e5389e6 /gcc
parent330df57938fe609a49c5cb047be443475cb9a3c3 (diff)
downloadgcc-4cac3f83c2b31ab352f537368e4efdadd5c47a9a.zip
gcc-4cac3f83c2b31ab352f537368e4efdadd5c47a9a.tar.gz
gcc-4cac3f83c2b31ab352f537368e4efdadd5c47a9a.tar.bz2
testsuite: add testcase for recent alias fix
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>
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/gcc.dg/ipa/ipa-icf-40.c16
1 files changed, 16 insertions, 0 deletions
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
index 0000000..ab328ba
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/ipa/ipa-icf-40.c
@@ -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" } } */