diff options
author | Richard Henderson <rth@redhat.com> | 2002-02-07 13:49:27 -0800 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2002-02-07 13:49:27 -0800 |
commit | ff9ea967119503f481fa76815c9828eccc179776 (patch) | |
tree | 4e79866716627a9bd921b5596cee8312cf0338ad /gcc | |
parent | c2ea3a40d9d7f302ba6f9279163d201410b39a4c (diff) | |
download | gcc-ff9ea967119503f481fa76815c9828eccc179776.zip gcc-ff9ea967119503f481fa76815c9828eccc179776.tar.gz gcc-ff9ea967119503f481fa76815c9828eccc179776.tar.bz2 |
new2.C: Arrange for allocated memory to be sufficiently aligned for integers.
* g++.old-deja/g++.brendan/new2.C: Arrange for allocated memory
to be sufficiently aligned for integers.
From-SVN: r49592
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.brendan/new2.C | 8 |
2 files changed, 9 insertions, 4 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 693b9a9..7cb3acd 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2002-02-07 Richard Henderson <rth@redhat.com> + + * g++.old-deja/g++.brendan/new2.C: Arrange for allocated memory + to be sufficiently aligned for integers. + 2002-02-07 Nathan Sidwell <nathan@codesourcery.com> * g++.dg/template/friend4.C: New test. diff --git a/gcc/testsuite/g++.old-deja/g++.brendan/new2.C b/gcc/testsuite/g++.old-deja/g++.brendan/new2.C index 3d0b518..fbb47fc 100644 --- a/gcc/testsuite/g++.old-deja/g++.brendan/new2.C +++ b/gcc/testsuite/g++.old-deja/g++.brendan/new2.C @@ -48,8 +48,8 @@ int main () return 0; } -char allocation_space[1000]; -char* allocation_ptr = allocation_space; +int allocation_space[100]; +int* allocation_ptr = allocation_space; void base::operator delete (void* p) { @@ -57,11 +57,11 @@ void base::operator delete (void* p) void *base::operator new (size_t size) { - char* return_value = allocation_ptr; + int* return_value = allocation_ptr; new_call_count++; if (size != expected_size) errors++; - allocation_ptr = allocation_ptr + size; + allocation_ptr += (size + sizeof(int) - 1) / sizeof(int); return (void*) return_value; } |