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.
This commit is contained in:
H.J. Lu 2021-08-02 20:34:13 -07:00
parent daaed9e365
commit 585394d30d
2 changed files with 29 additions and 0 deletions

View File

@ -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 } } */

View File

@ -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 } } */