@@ -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)] \