Merge branch 'restrict_support' of https://github.com/jfalcou/config into restrict_keyword

Add test case for boost_no_restrict_references.
Regenerate tests.
Tested msvc-10 - 14, intel 17, gcc-5.3.0.
This commit is contained in:
jzmaddock
2017-02-05 19:00:04 +00:00
9 changed files with 146 additions and 5 deletions

View File

@ -1,6 +1,6 @@
#
# *** DO NOT EDIT THIS FILE BY HAND ***
# This file was automatically generated on Mon Dec 12 19:37:08 2016
# This file was automatically generated on Sun Feb 5 18:12:09 2017
# by libs/config/tools/generate.cpp
# Copyright John Maddock.
# Use, modification and distribution are subject to the
@ -179,6 +179,7 @@ run-simple <define>TEST_BOOST_NO_PRIVATE_IN_AGGREGATE : private_in_aggregate ;
run-simple <define>TEST_BOOST_NO_POINTER_TO_MEMBER_CONST : pointer_to_member_const ;
run-simple <define>TEST_BOOST_NO_CXX11_RANGE_BASED_FOR : cxx11_range_based_for ;
run-simple <define>TEST_BOOST_NO_CXX11_RAW_LITERALS : cxx11_raw_literals ;
run-simple <define>TEST_BOOST_NO_RESTRICT_REFERENCES : restrict_references ;
run-simple <define>TEST_BOOST_NO_UNREACHABLE_RETURN_DETECTION : unreachable_return_detection ;
run-simple <define>TEST_BOOST_NO_RTTI : rtti ;
run-simple <define>TEST_BOOST_NO_CXX11_RVALUE_REFERENCES : cxx11_rvalue_references ;

View File

@ -1,4 +1,4 @@
// This file was automatically generated on Mon Dec 12 19:37:08 2016
// This file was automatically generated on Sun Feb 5 18:12:09 2017
// by libs/config/tools/generate.cpp
// Copyright John Maddock 2002-4.
// Use, modification and distribution are subject to the
@ -649,6 +649,10 @@ namespace test = boost_no_cxx11_range_based_for;
# include "../test/boost_no_raw_literals.ipp"
namespace test = boost_no_cxx11_raw_literals;
#endif
#ifdef TEST_BOOST_NO_RESTRICT_REFERENCES
# include "../test/boost_no_restrict_references.ipp"
namespace test = boost_no_restrict_references;
#endif
#ifdef TEST_BOOST_NO_UNREACHABLE_RETURN_DETECTION
# include "../test/boost_no_ret_det.ipp"
namespace test = boost_no_unreachable_return_detection;

View File

@ -588,7 +588,7 @@ namespace std{ using ::type_info; }
#if !defined(BOOST_RESTRICT)
# if defined(_MSC_VER)
# define BOOST_RESTRICT __restrict
# if !defined(BOOST_NO_RESTRICT_REFERENCES)
# if !defined(BOOST_NO_RESTRICT_REFERENCES) && (_MSC_FULL_VER < 190023026)
# define BOOST_NO_RESTRICT_REFERENCES
# endif
# elif defined(__GNUC__) && __GNUC__ > 3

View File

@ -1,7 +1,7 @@
#
# Regression test Jamfile for boost configuration setup.
# *** DO NOT EDIT THIS FILE BY HAND ***
# This file was automatically generated on Mon Dec 12 19:37:08 2016
# This file was automatically generated on Sun Feb 5 18:12:09 2017
# by libs/config/tools/generate.cpp
# Copyright John Maddock.
# Use, modification and distribution are subject to the
@ -502,6 +502,9 @@ test-suite "BOOST_NO_CXX11_RANGE_BASED_FOR" :
test-suite "BOOST_NO_CXX11_RAW_LITERALS" :
[ run ../no_raw_literals_pass.cpp ]
[ compile-fail ../no_raw_literals_fail.cpp ] ;
test-suite "BOOST_NO_RESTRICT_REFERENCES" :
[ run ../no_restrict_references_pass.cpp ]
[ compile-fail ../no_restrict_references_fail.cpp ] ;
test-suite "BOOST_NO_UNREACHABLE_RETURN_DETECTION" :
[ run ../no_ret_det_pass.cpp ]
[ compile-fail ../no_ret_det_fail.cpp ] ;

View File

@ -0,0 +1,47 @@
// (C) Copyright Beman Dawes 2009
// 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_RESTRICT_REFERENCES
// TITLE: We cannot apply BOOST_RESTRICT to a reference type.
// DESCRIPTION: We cannot apply BOOST_RESTRICT to a reference type
#include <boost/config.hpp>
namespace boost_no_restrict_references {
#ifdef _MSC_VER
#pragma warning(error:4227)
#endif
void sum2(int (& BOOST_RESTRICT a)[4], int (& BOOST_RESTRICT b)[4], int (&c)[4], int (&d)[4]) {
int i;
for (i = 0; i < 4; i++) {
a[i] = b[i] + c[i];
c[i] = b[i] + d[i];
}
}
int test()
{
int a[4] = { 1, 2, 3, 4 };
int b[4] = { 3, 4, 5, 6 };
int c[4] = { 0, 1, 3, 5 };
int d[4] = { 2, 4, 6, 8 };
sum2(a, b, c, d);
return 0;
}
#ifdef _MSC_VER
#pragma warning(default:4227)
#endif
}

View File

@ -1106,6 +1106,7 @@ void print_boost_macros()
PRINT_MACRO(BOOST_NO_POINTER_TO_MEMBER_CONST);
PRINT_MACRO(BOOST_NO_POINTER_TO_MEMBER_TEMPLATE_PARAMETERS);
PRINT_MACRO(BOOST_NO_PRIVATE_IN_AGGREGATE);
PRINT_MACRO(BOOST_NO_RESTRICT_REFERENCES);
PRINT_MACRO(BOOST_NO_RTTI);
PRINT_MACRO(BOOST_NO_SFINAE);
PRINT_MACRO(BOOST_NO_SFINAE_EXPR);
@ -1149,6 +1150,7 @@ void print_boost_macros()
// END GENERATED BLOCK
PRINT_MACRO(BOOST_INTEL);

View File

@ -1,4 +1,4 @@
// This file was automatically generated on Mon Dec 12 19:37:08 2016
// This file was automatically generated on Sun Feb 5 18:12:09 2017
// by libs/config/tools/generate.cpp
// Copyright John Maddock 2002-4.
// Use, modification and distribution are subject to the
@ -557,6 +557,11 @@ namespace boost_no_cxx11_range_based_for = empty_boost;
#else
namespace boost_no_cxx11_raw_literals = empty_boost;
#endif
#ifndef BOOST_NO_RESTRICT_REFERENCES
#include "boost_no_restrict_references.ipp"
#else
namespace boost_no_restrict_references = empty_boost;
#endif
#ifndef BOOST_NO_UNREACHABLE_RETURN_DETECTION
#include "boost_no_ret_det.ipp"
#else
@ -1816,6 +1821,11 @@ int main( int, char *[] )
std::cerr << "Failed test for BOOST_NO_CXX11_RAW_LITERALS at: " << __FILE__ << ":" << __LINE__ << std::endl;
++error_count;
}
if(0 != boost_no_restrict_references::test())
{
std::cerr << "Failed test for BOOST_NO_RESTRICT_REFERENCES at: " << __FILE__ << ":" << __LINE__ << std::endl;
++error_count;
}
if(0 != boost_no_unreachable_return_detection::test())
{
std::cerr << "Failed test for BOOST_NO_UNREACHABLE_RETURN_DETECTION at: " << __FILE__ << ":" << __LINE__ << std::endl;

View File

@ -0,0 +1,37 @@
// This file was automatically generated on Sun Feb 5 18:12:09 2017
// 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_RESTRICT_REFERENCES
// This file should not compile, if it does then
// BOOST_NO_RESTRICT_REFERENCES should not be defined.
// See file boost_no_restrict_references.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_RESTRICT_REFERENCES
#include "boost_no_restrict_references.ipp"
#else
#error "this file should not compile"
#endif
int main( int, char *[] )
{
return boost_no_restrict_references::test();
}

View File

@ -0,0 +1,37 @@
// This file was automatically generated on Sun Feb 5 18:12:09 2017
// 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_RESTRICT_REFERENCES
// This file should compile, if it does not then
// BOOST_NO_RESTRICT_REFERENCES should be defined.
// See file boost_no_restrict_references.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_RESTRICT_REFERENCES
#include "boost_no_restrict_references.ipp"
#else
namespace boost_no_restrict_references = empty_boost;
#endif
int main( int, char *[] )
{
return boost_no_restrict_references::test();
}