mirror of
https://github.com/boostorg/config.git
synced 2025-08-01 21:34:28 +02:00
Add test files as well
This commit is contained in:
28
test/boost_no_cxx11_addressof.ipp
Normal file
28
test/boost_no_cxx11_addressof.ipp
Normal 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;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
34
test/boost_no_cxx11_std_align.ipp
Normal file
34
test/boost_no_cxx11_std_align.ipp
Normal 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;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
37
test/no_cxx11_addressof_fail.cpp
Normal file
37
test/no_cxx11_addressof_fail.cpp
Normal 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();
|
||||||
|
}
|
||||||
|
|
37
test/no_cxx11_addressof_pass.cpp
Normal file
37
test/no_cxx11_addressof_pass.cpp
Normal 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();
|
||||||
|
}
|
||||||
|
|
37
test/no_cxx11_std_align_fail.cpp
Normal file
37
test/no_cxx11_std_align_fail.cpp
Normal 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();
|
||||||
|
}
|
||||||
|
|
37
test/no_cxx11_std_align_pass.cpp
Normal file
37
test/no_cxx11_std_align_pass.cpp
Normal 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();
|
||||||
|
}
|
||||||
|
|
Reference in New Issue
Block a user