[cfe-commits] [libcxx] r172631 - in /libcxx/trunk/test/language.support/support.dynamic/new.delete/new.delete.array: new_array.pass.cpp new_array_nothrow.pass.cpp new_array_nothrow_replace.pass.cpp new_array_replace.pass.cpp

Howard Hinnant hhinnant at apple.com
Wed Jan 16 09:56:06 PST 2013


Author: hhinnant
Date: Wed Jan 16 11:56:06 2013
New Revision: 172631

URL: http://llvm.org/viewvc/llvm-project?rev=172631&view=rev
Log:
Make a few tests optimization-proof.  These tests were failing under -O3 because the optimizer was eliminating the call to new.

Modified:
    libcxx/trunk/test/language.support/support.dynamic/new.delete/new.delete.array/new_array.pass.cpp
    libcxx/trunk/test/language.support/support.dynamic/new.delete/new.delete.array/new_array_nothrow.pass.cpp
    libcxx/trunk/test/language.support/support.dynamic/new.delete/new.delete.array/new_array_nothrow_replace.pass.cpp
    libcxx/trunk/test/language.support/support.dynamic/new.delete/new.delete.array/new_array_replace.pass.cpp

Modified: libcxx/trunk/test/language.support/support.dynamic/new.delete/new.delete.array/new_array.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/language.support/support.dynamic/new.delete/new.delete.array/new_array.pass.cpp?rev=172631&r1=172630&r2=172631&view=diff
==============================================================================
--- libcxx/trunk/test/language.support/support.dynamic/new.delete/new.delete.array/new_array.pass.cpp (original)
+++ libcxx/trunk/test/language.support/support.dynamic/new.delete/new.delete.array/new_array.pass.cpp Wed Jan 16 11:56:06 2013
@@ -35,7 +35,7 @@
     std::set_new_handler(new_handler);
     try
     {
-        void* vp = operator new[] (std::numeric_limits<std::size_t>::max());
+        void*volatile vp = operator new[] (std::numeric_limits<std::size_t>::max());
         assert(false);
     }
     catch (std::bad_alloc&)

Modified: libcxx/trunk/test/language.support/support.dynamic/new.delete/new.delete.array/new_array_nothrow.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/language.support/support.dynamic/new.delete/new.delete.array/new_array_nothrow.pass.cpp?rev=172631&r1=172630&r2=172631&view=diff
==============================================================================
--- libcxx/trunk/test/language.support/support.dynamic/new.delete/new.delete.array/new_array_nothrow.pass.cpp (original)
+++ libcxx/trunk/test/language.support/support.dynamic/new.delete/new.delete.array/new_array_nothrow.pass.cpp Wed Jan 16 11:56:06 2013
@@ -35,7 +35,7 @@
     std::set_new_handler(new_handler);
     try
     {
-        void* vp = operator new [] (std::numeric_limits<std::size_t>::max(), std::nothrow);
+        void*volatile vp = operator new [] (std::numeric_limits<std::size_t>::max(), std::nothrow);
         assert(new_handler_called == 1);
         assert(vp == 0);
     }

Modified: libcxx/trunk/test/language.support/support.dynamic/new.delete/new.delete.array/new_array_nothrow_replace.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/language.support/support.dynamic/new.delete/new.delete.array/new_array_nothrow_replace.pass.cpp?rev=172631&r1=172630&r2=172631&view=diff
==============================================================================
--- libcxx/trunk/test/language.support/support.dynamic/new.delete/new.delete.array/new_array_nothrow_replace.pass.cpp (original)
+++ libcxx/trunk/test/language.support/support.dynamic/new.delete/new.delete.array/new_array_nothrow_replace.pass.cpp Wed Jan 16 11:56:06 2013
@@ -29,7 +29,7 @@
     std::free(p);
 }
 
-int A_constructed = 0;
+volatile int A_constructed = 0;
 
 struct A
 {

Modified: libcxx/trunk/test/language.support/support.dynamic/new.delete/new.delete.array/new_array_replace.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/language.support/support.dynamic/new.delete/new.delete.array/new_array_replace.pass.cpp?rev=172631&r1=172630&r2=172631&view=diff
==============================================================================
--- libcxx/trunk/test/language.support/support.dynamic/new.delete/new.delete.array/new_array_replace.pass.cpp (original)
+++ libcxx/trunk/test/language.support/support.dynamic/new.delete/new.delete.array/new_array_replace.pass.cpp Wed Jan 16 11:56:06 2013
@@ -15,7 +15,7 @@
 #include <cassert>
 #include <limits>
 
-int new_called = 0;
+volatile int new_called = 0;
 
 void* operator new(std::size_t s) throw(std::bad_alloc)
 {





More information about the cfe-commits mailing list