diff options
author | Doug Kwan <dougkwan@google.com> | 2009-04-24 20:25:02 +0000 |
---|---|---|
committer | Doug Kwan <dougkwan@gcc.gnu.org> | 2009-04-24 20:25:02 +0000 |
commit | dc7497599ad542e24bfa524779948c15e7491f67 (patch) | |
tree | a3fde4492e2cdf48adb1de197f702d6ff278a54a | |
parent | 735b94a740d585af15678732b069ca905ef6e78a (diff) | |
download | gcc-dc7497599ad542e24bfa524779948c15e7491f67.zip gcc-dc7497599ad542e24bfa524779948c15e7491f67.tar.gz gcc-dc7497599ad542e24bfa524779948c15e7491f67.tar.bz2 |
copy7.C: Only abort in memcpy if source and destination are the same.
2008-04-24 Doug Kwan <dougkwan@google.com>
* g++.dg/init/copy7.C: Only abort in memcpy if source and
destination are the same.
From-SVN: r146744
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/init/copy7.C | 9 |
2 files changed, 13 insertions, 1 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e5b8fff..493acaa 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2008-04-24 Doug Kwan <dougkwan@google.com> + + * g++.dg/init/copy7.C: Only abort in memcpy if source and + destination are the same. + 2009-04-24 Richard Guenther <rguenther@suse.de> * gcc.dg/tree-ssa/vrp48.c: New testcase. diff --git a/gcc/testsuite/g++.dg/init/copy7.C b/gcc/testsuite/g++.dg/init/copy7.C index f4364f3..20e1e47 100644 --- a/gcc/testsuite/g++.dg/init/copy7.C +++ b/gcc/testsuite/g++.dg/init/copy7.C @@ -6,7 +6,14 @@ extern "C" void abort(); extern "C" void * memcpy(void *dest, void *src, __SIZE_TYPE__ n) { - abort(); + if (dest == src) + abort(); + else + { + __SIZE_TYPE__ i; + for (i = 0; i < n; i++) + ((char *)dest)[i] = ((const char*)src)[i]; + } } struct A |