Add test files as well

This commit is contained in:
Peter Dimov
2014-02-11 18:25:38 +02:00
parent 9c117007ba
commit d9d19688a1
6 changed files with 210 additions and 0 deletions

View File

@@ -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 <memory> doesn't have a working std::addressof
// DESCRIPTION: The compiler does not support the function std::addressof added to <memory>
#include <memory>
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;
}
}

View File

@@ -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 <memory> doesn't have a working std::align
// DESCRIPTION: The compiler does not support the function std::align added to <memory>
#include <memory>
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;
}
}

View File

@@ -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 <boost/config.hpp>
#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();
}

View File

@@ -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 <boost/config.hpp>
#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();
}

View File

@@ -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 <boost/config.hpp>
#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();
}

View File

@@ -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 <boost/config.hpp>
#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();
}