public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-2681] x86: Add testcases for PR target/80566
@ 2021-08-03  3:38 H.J. Lu
  0 siblings, 0 replies; only message in thread
From: H.J. Lu @ 2021-08-03  3:38 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:585394d30dc975566186a02e75baf301dbbcc9ba

commit r12-2681-g585394d30dc975566186a02e75baf301dbbcc9ba
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Mon Aug 2 20:34:13 2021 -0700

    x86: Add testcases for PR target/80566
    
            PR target/80566
            * g++.target/i386/pr80566-1.C: New test.
            * g++.target/i386/pr80566-2.C: Likewise.

Diff:
---
 gcc/testsuite/g++.target/i386/pr80566-1.C | 15 +++++++++++++++
 gcc/testsuite/g++.target/i386/pr80566-2.C | 14 ++++++++++++++
 2 files changed, 29 insertions(+)

diff --git a/gcc/testsuite/g++.target/i386/pr80566-1.C b/gcc/testsuite/g++.target/i386/pr80566-1.C
new file mode 100644
index 00000000000..753f9740529
--- /dev/null
+++ b/gcc/testsuite/g++.target/i386/pr80566-1.C
@@ -0,0 +1,15 @@
+// { dg-do compile }
+// { dg-options "-O2 -march=haswell" }
+
+#include <cstring>
+
+int *
+foo()
+{
+  int * p = new int[16];
+  memset(p,0,16*sizeof(int));
+  return p;
+}
+
+/* { dg-final { scan-assembler-times "vpxor\[ \\t\]+\[^\n\]*%xmm" 1 } } */
+/* { dg-final { scan-assembler-times "vmovdqu\[ \\t\]+\[^\n\]*%ymm" 2 } } */
diff --git a/gcc/testsuite/g++.target/i386/pr80566-2.C b/gcc/testsuite/g++.target/i386/pr80566-2.C
new file mode 100644
index 00000000000..2a2e82d0a3a
--- /dev/null
+++ b/gcc/testsuite/g++.target/i386/pr80566-2.C
@@ -0,0 +1,14 @@
+// { dg-do compile }
+// { dg-options "-O2 -march=haswell" }
+
+#include <cstring>
+
+int *
+foo(int * q)
+{
+  int * p = new int[16];
+  memcpy(q,p,16*sizeof(int));
+  return p;
+}
+
+/* { dg-final { scan-assembler-times "vmovdqu\[ \\t\]+\[^\n\]*%ymm" 4 } } */


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-08-03  3:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-03  3:38 [gcc r12-2681] x86: Add testcases for PR target/80566 H.J. Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).