Fix test bug with mismatched alignment in allocate/deallocate
authorJonathan Wakely <jwakely@redhat.com>
Mon, 20 May 2019 11:14:56 +0000 (12:14 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Mon, 20 May 2019 11:14:56 +0000 (12:14 +0100)
* testsuite/experimental/memory_resource/new_delete_resource.cc: Fix
test by passing correct alignment to deallocate function.

From-SVN: r271408

libstdc++-v3/ChangeLog
libstdc++-v3/testsuite/experimental/memory_resource/new_delete_resource.cc

index c7b20f10dc52d8840f98ec972f7831a6660895fa..0b07d0efdcde5b50efc2b39bba8f8429587cdd14 100644 (file)
@@ -1,3 +1,8 @@
+2019-05-20  Jonathan Wakely  <jwakely@redhat.com>
+
+       * testsuite/experimental/memory_resource/new_delete_resource.cc: Fix
+       test by passing correct alignment to deallocate function.
+
 2019-05-18  Jonathan Wakely  <jwakely@redhat.com>
 
        PR libstdc++/90520
index 5c5a0a4d7e3a7cad5c37db629327f9db29c373af..41232b6fc6745ebdb0eaabbb4e7a4632809ea0d2 100644 (file)
@@ -103,7 +103,6 @@ test02()
 
 void
 test03()
-
 {
   using std::max_align_t;
   using std::size_t;
@@ -123,7 +122,8 @@ test03()
   p = r1->allocate(2, alignof(char));
   VERIFY( bytes_allocated == 2 );
   VERIFY( aligned<max_align_t>(p) );
-  r1->deallocate(p, 2);
+  r1->deallocate(p, 2, alignof(char));
+  __builtin_printf("%d\n", (int)bytes_allocated);
   VERIFY( bytes_allocated == 0 );
 
   p = r1->allocate(3, alignof(short));