mirror of
https://gcc.gnu.org/git/gcc.git
synced 2024-11-24 11:24:05 +08:00
libstdc++: Define effective-target for net::ip features [PR 100351]
Define a new effective-target keyword so that tests for the Networking TS <experimental/internet> header can be skipped on targets where none of it can be usefully defined. libstdc++-v3/ChangeLog: PR libstdc++/100180 PR libstdc++/100286 PR libstdc++/100351 * testsuite/experimental/net/internet/address/v4/comparisons.cc: Use new effective-target keyword. * testsuite/experimental/net/internet/address/v4/cons.cc: Likewise. * testsuite/experimental/net/internet/address/v4/creation.cc: Likewise. * testsuite/experimental/net/internet/address/v4/members.cc: Likewise. * testsuite/experimental/net/internet/address/v6/members.cc: Likewise. * testsuite/experimental/net/internet/resolver/base.cc: Likewise. * testsuite/experimental/net/internet/resolver/ops/lookup.cc: Likewise. * testsuite/experimental/net/internet/resolver/ops/reverse.cc: Likewise. * testsuite/experimental/net/internet/socket/opt.cc: Likewise. * testsuite/experimental/net/internet/tcp.cc: Likewise. * testsuite/experimental/net/internet/udp.cc: Likewise. * testsuite/lib/libstdc++.exp (check_effective_target_net_ts_ip): New proc to check net_ts_ip et.
This commit is contained in:
parent
74fe10aedb
commit
57028ff2d3
@ -16,6 +16,7 @@
|
||||
// <http://www.gnu.org/licenses/>.
|
||||
|
||||
// { dg-do run { target c++14 } }
|
||||
// { dg-require-effective-target net_ts_ip }
|
||||
// { dg-add-options net_ts }
|
||||
|
||||
#include <experimental/internet>
|
||||
@ -26,8 +27,6 @@ using std::experimental::net::ip::address_v4;
|
||||
void
|
||||
test01()
|
||||
{
|
||||
bool test __attribute__((unused)) = false;
|
||||
|
||||
address_v4 addrs[] = {
|
||||
address_v4::any(), address_v4::loopback(), address_v4::broadcast(),
|
||||
address_v4{0x11001100}, address_v4{0xEFEFEFEF}
|
||||
|
@ -16,6 +16,7 @@
|
||||
// <http://www.gnu.org/licenses/>.
|
||||
|
||||
// { dg-do run { target c++14 } }
|
||||
// { dg-require-effective-target net_ts_ip }
|
||||
// { dg-add-options net_ts }
|
||||
|
||||
#include <experimental/internet>
|
||||
|
@ -16,6 +16,7 @@
|
||||
// <http://www.gnu.org/licenses/>.
|
||||
|
||||
// { dg-do run { target c++14 } }
|
||||
// { dg-require-effective-target net_ts_ip }
|
||||
// { dg-add-options net_ts }
|
||||
|
||||
#include <experimental/internet>
|
||||
@ -27,8 +28,6 @@ using net::ip::address_v4;
|
||||
void
|
||||
test01()
|
||||
{
|
||||
bool test __attribute__((unused)) = false;
|
||||
|
||||
auto a0 = make_address_v4( address_v4::bytes_type{} );
|
||||
VERIFY( a0.to_uint() == 0 );
|
||||
VERIFY( a0.to_bytes() == address_v4::bytes_type{} );
|
||||
@ -42,8 +41,6 @@ test01()
|
||||
void
|
||||
test02()
|
||||
{
|
||||
bool test __attribute__((unused)) = false;
|
||||
|
||||
auto a0 = net::ip::make_address_v4(0u);
|
||||
VERIFY( a0.to_uint() == 0 );
|
||||
VERIFY( a0.to_bytes() == address_v4::bytes_type{} );
|
||||
@ -57,8 +54,6 @@ test02()
|
||||
void
|
||||
test03()
|
||||
{
|
||||
bool test __attribute__((unused)) = false;
|
||||
|
||||
auto a1 = net::ip::make_address_v4("127.0.0.1");
|
||||
VERIFY( a1.is_loopback() );
|
||||
auto a2 = net::ip::make_address_v4(std::string{"127.0.0.2"});
|
||||
|
@ -16,6 +16,7 @@
|
||||
// <http://www.gnu.org/licenses/>.
|
||||
|
||||
// { dg-do run { target c++14 } }
|
||||
// { dg-require-effective-target net_ts_ip }
|
||||
// { dg-add-options net_ts }
|
||||
|
||||
#include <experimental/internet>
|
||||
|
@ -16,6 +16,7 @@
|
||||
// <http://www.gnu.org/licenses/>.
|
||||
|
||||
// { dg-do run { target c++14 } }
|
||||
// { dg-require-effective-target net_ts_ip }
|
||||
// { dg-add-options net_ts }
|
||||
|
||||
#include <experimental/internet>
|
||||
|
@ -16,6 +16,7 @@
|
||||
// <http://www.gnu.org/licenses/>.
|
||||
|
||||
// { dg-do compile { target c++14 } }
|
||||
// { dg-require-effective-target net_ts_ip }
|
||||
// { dg-add-options net_ts }
|
||||
|
||||
#include <experimental/internet>
|
||||
|
@ -16,6 +16,7 @@
|
||||
// <http://www.gnu.org/licenses/>.
|
||||
|
||||
// { dg-do run { target c++14 } }
|
||||
// { dg-require-effective-target net_ts_ip }
|
||||
// { dg-add-options net_ts }
|
||||
|
||||
#include <experimental/internet>
|
||||
@ -26,8 +27,6 @@ using namespace std::experimental::net;
|
||||
void
|
||||
test01()
|
||||
{
|
||||
bool test __attribute__((unused)) = false;
|
||||
|
||||
std::error_code ec;
|
||||
io_context ctx;
|
||||
ip::tcp::resolver resolv(ctx);
|
||||
@ -44,8 +43,6 @@ test01()
|
||||
void
|
||||
test02()
|
||||
{
|
||||
bool test __attribute__((unused)) = false;
|
||||
|
||||
std::error_code ec;
|
||||
io_context ctx;
|
||||
ip::tcp::resolver resolv(ctx);
|
||||
@ -83,8 +80,6 @@ test02()
|
||||
void
|
||||
test03()
|
||||
{
|
||||
bool test __attribute__((unused)) = false;
|
||||
|
||||
std::error_code ec;
|
||||
io_context ctx;
|
||||
ip::tcp::resolver resolv(ctx);
|
||||
|
@ -16,6 +16,7 @@
|
||||
// <http://www.gnu.org/licenses/>.
|
||||
|
||||
// { dg-do run { target c++14 } }
|
||||
// { dg-require-effective-target net_ts_ip }
|
||||
// { dg-add-options net_ts }
|
||||
|
||||
#include <experimental/internet>
|
||||
@ -26,8 +27,6 @@ using namespace std::experimental::net;
|
||||
void
|
||||
test01()
|
||||
{
|
||||
bool test __attribute__((unused)) = false;
|
||||
|
||||
std::error_code ec;
|
||||
io_context ctx;
|
||||
ip::tcp::resolver resolv(ctx);
|
||||
|
@ -1,4 +1,5 @@
|
||||
// { dg-do run { target c++14 } }
|
||||
// { dg-require-effective-target net_ts_ip }
|
||||
|
||||
#include <experimental/internet>
|
||||
#include <testsuite_common_types.h>
|
||||
|
@ -1,9 +1,9 @@
|
||||
// { dg-do compile { target c++14 } }
|
||||
// { dg-require-effective-target net_ts_ip }
|
||||
|
||||
#include <experimental/internet>
|
||||
#include <type_traits>
|
||||
|
||||
#if __has_include(<netinet/in.h>)
|
||||
using namespace std;
|
||||
using std::experimental::net::ip::tcp;
|
||||
using std::experimental::net::ip::basic_endpoint;
|
||||
@ -42,4 +42,3 @@ test01()
|
||||
static_assert( tcp::v4().protocol() == IPPROTO_TCP, "" );
|
||||
static_assert( tcp::v6().protocol() == IPPROTO_TCP, "" );
|
||||
}
|
||||
#endif
|
||||
|
@ -1,9 +1,9 @@
|
||||
// { dg-do compile { target c++14 } }
|
||||
// { dg-require-effective-target net_ts_ip }
|
||||
|
||||
#include <experimental/internet>
|
||||
#include <type_traits>
|
||||
|
||||
#if __has_include(<netinet/in.h>)
|
||||
using namespace std;
|
||||
using std::experimental::net::ip::udp;
|
||||
using std::experimental::net::ip::basic_endpoint;
|
||||
@ -40,4 +40,3 @@ test01()
|
||||
static_assert( udp::v4().protocol() == IPPROTO_UDP, "" );
|
||||
static_assert( udp::v6().protocol() == IPPROTO_UDP, "" );
|
||||
}
|
||||
#endif
|
||||
|
@ -1331,6 +1331,14 @@ proc check_effective_target_ieee-floats { } {
|
||||
}]
|
||||
}
|
||||
|
||||
# Return 1 if Networking TS net::ip features are available.
|
||||
proc check_effective_target_net_ts_ip { } {
|
||||
return [check_v3_target_prop_cached et_net_ts_ip {
|
||||
set cond "__has_include(<netinet/in.h>)"
|
||||
return [v3_check_preprocessor_condition net_ts_ip $cond]
|
||||
}]
|
||||
}
|
||||
|
||||
set additional_prunes ""
|
||||
|
||||
if { [info exists env(GCC_RUNTEST_PARALLELIZE_DIR)] \
|
||||
|
Loading…
Reference in New Issue
Block a user