new2.C: Arrange for allocated memory to be sufficiently aligned for integers.
authorRichard Henderson <rth@redhat.com>
Thu, 7 Feb 2002 21:49:27 +0000 (13:49 -0800)
committerRichard Henderson <rth@gcc.gnu.org>
Thu, 7 Feb 2002 21:49:27 +0000 (13:49 -0800)
        * g++.old-deja/g++.brendan/new2.C: Arrange for allocated memory
        to be sufficiently aligned for integers.

From-SVN: r49592

gcc/testsuite/ChangeLog
gcc/testsuite/g++.old-deja/g++.brendan/new2.C

index 693b9a911463bbcd7f884c4218e7de8a975ee542..7cb3acdc43cfe41d73d2983a60ff09f64d9dfe6a 100644 (file)
@@ -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.
index 3d0b51808968411b67636e7ad3b561f5a869c4bd..fbb47fce38cefdbbf8889fcd6c6a6c719565ad52 100644 (file)
@@ -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;
 }