forked from boostorg/config
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:
@ -1,6 +1,6 @@
|
|||||||
#
|
#
|
||||||
# *** DO NOT EDIT THIS FILE BY HAND ***
|
# *** 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
|
# by libs/config/tools/generate.cpp
|
||||||
# Copyright John Maddock.
|
# Copyright John Maddock.
|
||||||
# Use, modification and distribution are subject to the
|
# 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_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_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_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_UNREACHABLE_RETURN_DETECTION : unreachable_return_detection ;
|
||||||
run-simple <define>TEST_BOOST_NO_RTTI : rtti ;
|
run-simple <define>TEST_BOOST_NO_RTTI : rtti ;
|
||||||
run-simple <define>TEST_BOOST_NO_CXX11_RVALUE_REFERENCES : cxx11_rvalue_references ;
|
run-simple <define>TEST_BOOST_NO_CXX11_RVALUE_REFERENCES : cxx11_rvalue_references ;
|
||||||
|
@ -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
|
// by libs/config/tools/generate.cpp
|
||||||
// Copyright John Maddock 2002-4.
|
// Copyright John Maddock 2002-4.
|
||||||
// Use, modification and distribution are subject to the
|
// 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"
|
# include "../test/boost_no_raw_literals.ipp"
|
||||||
namespace test = boost_no_cxx11_raw_literals;
|
namespace test = boost_no_cxx11_raw_literals;
|
||||||
#endif
|
#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
|
#ifdef TEST_BOOST_NO_UNREACHABLE_RETURN_DETECTION
|
||||||
# include "../test/boost_no_ret_det.ipp"
|
# include "../test/boost_no_ret_det.ipp"
|
||||||
namespace test = boost_no_unreachable_return_detection;
|
namespace test = boost_no_unreachable_return_detection;
|
||||||
|
@ -588,7 +588,7 @@ namespace std{ using ::type_info; }
|
|||||||
#if !defined(BOOST_RESTRICT)
|
#if !defined(BOOST_RESTRICT)
|
||||||
# if defined(_MSC_VER)
|
# if defined(_MSC_VER)
|
||||||
# define BOOST_RESTRICT __restrict
|
# 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
|
# define BOOST_NO_RESTRICT_REFERENCES
|
||||||
# endif
|
# endif
|
||||||
# elif defined(__GNUC__) && __GNUC__ > 3
|
# elif defined(__GNUC__) && __GNUC__ > 3
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# Regression test Jamfile for boost configuration setup.
|
# Regression test Jamfile for boost configuration setup.
|
||||||
# *** DO NOT EDIT THIS FILE BY HAND ***
|
# *** 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
|
# by libs/config/tools/generate.cpp
|
||||||
# Copyright John Maddock.
|
# Copyright John Maddock.
|
||||||
# Use, modification and distribution are subject to the
|
# 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" :
|
test-suite "BOOST_NO_CXX11_RAW_LITERALS" :
|
||||||
[ run ../no_raw_literals_pass.cpp ]
|
[ run ../no_raw_literals_pass.cpp ]
|
||||||
[ compile-fail ../no_raw_literals_fail.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" :
|
test-suite "BOOST_NO_UNREACHABLE_RETURN_DETECTION" :
|
||||||
[ run ../no_ret_det_pass.cpp ]
|
[ run ../no_ret_det_pass.cpp ]
|
||||||
[ compile-fail ../no_ret_det_fail.cpp ] ;
|
[ compile-fail ../no_ret_det_fail.cpp ] ;
|
||||||
|
47
test/boost_no_restrict_references.ipp
Normal file
47
test/boost_no_restrict_references.ipp
Normal 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
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -1106,6 +1106,7 @@ void print_boost_macros()
|
|||||||
PRINT_MACRO(BOOST_NO_POINTER_TO_MEMBER_CONST);
|
PRINT_MACRO(BOOST_NO_POINTER_TO_MEMBER_CONST);
|
||||||
PRINT_MACRO(BOOST_NO_POINTER_TO_MEMBER_TEMPLATE_PARAMETERS);
|
PRINT_MACRO(BOOST_NO_POINTER_TO_MEMBER_TEMPLATE_PARAMETERS);
|
||||||
PRINT_MACRO(BOOST_NO_PRIVATE_IN_AGGREGATE);
|
PRINT_MACRO(BOOST_NO_PRIVATE_IN_AGGREGATE);
|
||||||
|
PRINT_MACRO(BOOST_NO_RESTRICT_REFERENCES);
|
||||||
PRINT_MACRO(BOOST_NO_RTTI);
|
PRINT_MACRO(BOOST_NO_RTTI);
|
||||||
PRINT_MACRO(BOOST_NO_SFINAE);
|
PRINT_MACRO(BOOST_NO_SFINAE);
|
||||||
PRINT_MACRO(BOOST_NO_SFINAE_EXPR);
|
PRINT_MACRO(BOOST_NO_SFINAE_EXPR);
|
||||||
@ -1149,6 +1150,7 @@ void print_boost_macros()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// END GENERATED BLOCK
|
// END GENERATED BLOCK
|
||||||
|
|
||||||
PRINT_MACRO(BOOST_INTEL);
|
PRINT_MACRO(BOOST_INTEL);
|
||||||
|
@ -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
|
// by libs/config/tools/generate.cpp
|
||||||
// Copyright John Maddock 2002-4.
|
// Copyright John Maddock 2002-4.
|
||||||
// Use, modification and distribution are subject to the
|
// Use, modification and distribution are subject to the
|
||||||
@ -557,6 +557,11 @@ namespace boost_no_cxx11_range_based_for = empty_boost;
|
|||||||
#else
|
#else
|
||||||
namespace boost_no_cxx11_raw_literals = empty_boost;
|
namespace boost_no_cxx11_raw_literals = empty_boost;
|
||||||
#endif
|
#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
|
#ifndef BOOST_NO_UNREACHABLE_RETURN_DETECTION
|
||||||
#include "boost_no_ret_det.ipp"
|
#include "boost_no_ret_det.ipp"
|
||||||
#else
|
#else
|
||||||
@ -1816,6 +1821,11 @@ int main( int, char *[] )
|
|||||||
std::cerr << "Failed test for BOOST_NO_CXX11_RAW_LITERALS at: " << __FILE__ << ":" << __LINE__ << std::endl;
|
std::cerr << "Failed test for BOOST_NO_CXX11_RAW_LITERALS at: " << __FILE__ << ":" << __LINE__ << std::endl;
|
||||||
++error_count;
|
++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())
|
if(0 != boost_no_unreachable_return_detection::test())
|
||||||
{
|
{
|
||||||
std::cerr << "Failed test for BOOST_NO_UNREACHABLE_RETURN_DETECTION at: " << __FILE__ << ":" << __LINE__ << std::endl;
|
std::cerr << "Failed test for BOOST_NO_UNREACHABLE_RETURN_DETECTION at: " << __FILE__ << ":" << __LINE__ << std::endl;
|
||||||
|
37
test/no_restrict_references_fail.cpp
Normal file
37
test/no_restrict_references_fail.cpp
Normal 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();
|
||||||
|
}
|
||||||
|
|
37
test/no_restrict_references_pass.cpp
Normal file
37
test/no_restrict_references_pass.cpp
Normal 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();
|
||||||
|
}
|
||||||
|
|
Reference in New Issue
Block a user