diff --git a/test/boost_no_cxx11_addressof.ipp b/test/boost_no_cxx11_addressof.ipp new file mode 100644 index 00000000..4f0a5e3c --- /dev/null +++ b/test/boost_no_cxx11_addressof.ipp @@ -0,0 +1,28 @@ +// (C) Copyright John Maddock 2012 +// (C) Copyright Peter Dimov 2014 + +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +// See http://www.boost.org/libs/config for more information. + +// MACRO: BOOST_NO_CXX11_ADDRESSOF +// TITLE: C++11 doesn't have a working std::addressof +// DESCRIPTION: The compiler does not support the function std::addressof added to + +#include + +namespace boost_no_cxx11_addressof { + +void x3() +{ +} + +int test() +{ + int x1, x2[3]; + return std::addressof(x1) != &x1 || std::addressof(x2) != &x2 || std::addressof(x3) != &x3; +} + +} diff --git a/test/boost_no_cxx11_std_align.ipp b/test/boost_no_cxx11_std_align.ipp new file mode 100644 index 00000000..145e24c6 --- /dev/null +++ b/test/boost_no_cxx11_std_align.ipp @@ -0,0 +1,34 @@ +// (C) Copyright John Maddock 2012 +// (C) Copyright Peter Dimov 2014 + +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +// See http://www.boost.org/libs/config for more information. + +// MACRO: BOOST_NO_CXX11_STD_ALIGN +// TITLE: C++11 doesn't have a working std::align +// DESCRIPTION: The compiler does not support the function std::align added to + +#include + +namespace boost_no_cxx11_std_align { + +int test() +{ + char buffer[ 32 ]; + + void * ptr = buffer + 1; + std::size_t space = sizeof( buffer ) - 1; + + void * p2 = std::align( 4, 2, ptr, space ); + + if( p2 == 0 ) return 1; + if( p2 != ptr ) return 1; + if( (size_t)p2 % 4 ) return 1; + + return 0; +} + +} diff --git a/test/no_cxx11_addressof_fail.cpp b/test/no_cxx11_addressof_fail.cpp new file mode 100644 index 00000000..9216b5ef --- /dev/null +++ b/test/no_cxx11_addressof_fail.cpp @@ -0,0 +1,37 @@ +// This file was automatically generated on Tue Feb 11 17:12:27 2014 +// by libs/config/tools/generate.cpp +// Copyright John Maddock 2002-4. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +// See http://www.boost.org/libs/config for the most recent version.// +// Revision $Id$ +// + + +// Test file for macro BOOST_NO_CXX11_ADDRESSOF +// This file should not compile, if it does then +// BOOST_NO_CXX11_ADDRESSOF should not be defined. +// See file boost_no_cxx11_addressof.ipp for details + +// Must not have BOOST_ASSERT_CONFIG set; it defeats +// the objective of this file: +#ifdef BOOST_ASSERT_CONFIG +# undef BOOST_ASSERT_CONFIG +#endif + +#include +#include "test.hpp" + +#ifdef BOOST_NO_CXX11_ADDRESSOF +#include "boost_no_cxx11_addressof.ipp" +#else +#error "this file should not compile" +#endif + +int main( int, char *[] ) +{ + return boost_no_cxx11_addressof::test(); +} + diff --git a/test/no_cxx11_addressof_pass.cpp b/test/no_cxx11_addressof_pass.cpp new file mode 100644 index 00000000..e4e84abc --- /dev/null +++ b/test/no_cxx11_addressof_pass.cpp @@ -0,0 +1,37 @@ +// This file was automatically generated on Tue Feb 11 17:12:27 2014 +// by libs/config/tools/generate.cpp +// Copyright John Maddock 2002-4. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +// See http://www.boost.org/libs/config for the most recent version.// +// Revision $Id$ +// + + +// Test file for macro BOOST_NO_CXX11_ADDRESSOF +// This file should compile, if it does not then +// BOOST_NO_CXX11_ADDRESSOF should be defined. +// See file boost_no_cxx11_addressof.ipp for details + +// Must not have BOOST_ASSERT_CONFIG set; it defeats +// the objective of this file: +#ifdef BOOST_ASSERT_CONFIG +# undef BOOST_ASSERT_CONFIG +#endif + +#include +#include "test.hpp" + +#ifndef BOOST_NO_CXX11_ADDRESSOF +#include "boost_no_cxx11_addressof.ipp" +#else +namespace boost_no_cxx11_addressof = empty_boost; +#endif + +int main( int, char *[] ) +{ + return boost_no_cxx11_addressof::test(); +} + diff --git a/test/no_cxx11_std_align_fail.cpp b/test/no_cxx11_std_align_fail.cpp new file mode 100644 index 00000000..7a87dea2 --- /dev/null +++ b/test/no_cxx11_std_align_fail.cpp @@ -0,0 +1,37 @@ +// This file was automatically generated on Tue Feb 11 16:14:42 2014 +// by libs/config/tools/generate.cpp +// Copyright John Maddock 2002-4. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +// See http://www.boost.org/libs/config for the most recent version.// +// Revision $Id$ +// + + +// Test file for macro BOOST_NO_CXX11_STD_ALIGN +// This file should not compile, if it does then +// BOOST_NO_CXX11_STD_ALIGN should not be defined. +// See file boost_no_cxx11_std_align.ipp for details + +// Must not have BOOST_ASSERT_CONFIG set; it defeats +// the objective of this file: +#ifdef BOOST_ASSERT_CONFIG +# undef BOOST_ASSERT_CONFIG +#endif + +#include +#include "test.hpp" + +#ifdef BOOST_NO_CXX11_STD_ALIGN +#include "boost_no_cxx11_std_align.ipp" +#else +#error "this file should not compile" +#endif + +int main( int, char *[] ) +{ + return boost_no_cxx11_std_align::test(); +} + diff --git a/test/no_cxx11_std_align_pass.cpp b/test/no_cxx11_std_align_pass.cpp new file mode 100644 index 00000000..4ee4ba65 --- /dev/null +++ b/test/no_cxx11_std_align_pass.cpp @@ -0,0 +1,37 @@ +// This file was automatically generated on Tue Feb 11 16:14:42 2014 +// by libs/config/tools/generate.cpp +// Copyright John Maddock 2002-4. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +// See http://www.boost.org/libs/config for the most recent version.// +// Revision $Id$ +// + + +// Test file for macro BOOST_NO_CXX11_STD_ALIGN +// This file should compile, if it does not then +// BOOST_NO_CXX11_STD_ALIGN should be defined. +// See file boost_no_cxx11_std_align.ipp for details + +// Must not have BOOST_ASSERT_CONFIG set; it defeats +// the objective of this file: +#ifdef BOOST_ASSERT_CONFIG +# undef BOOST_ASSERT_CONFIG +#endif + +#include +#include "test.hpp" + +#ifndef BOOST_NO_CXX11_STD_ALIGN +#include "boost_no_cxx11_std_align.ipp" +#else +namespace boost_no_cxx11_std_align = empty_boost; +#endif + +int main( int, char *[] ) +{ + return boost_no_cxx11_std_align::test(); +} +