| 1 |
// { dg-do compile { target c++11 } } |
| 2 |
|
| 3 |
// Copyright (C) 2007-2025 Free Software Foundation, Inc. |
| 4 |
// |
| 5 |
// This file is part of the GNU ISO C++ Library. This library is free |
| 6 |
// software; you can redistribute it and/or modify it under the |
| 7 |
// terms of the GNU General Public License as published by the |
| 8 |
// Free Software Foundation; either version 3, or (at your option) |
| 9 |
// any later version. |
| 10 |
|
| 11 |
// This library is distributed in the hope that it will be useful, |
| 12 |
// but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 |
// GNU General Public License for more details. |
| 15 |
|
| 16 |
// You should have received a copy of the GNU General Public License along |
| 17 |
// with this library; see the file COPYING3. If not see |
| 18 |
// <http://www.gnu.org/licenses/>. |
| 19 |
|
| 20 |
#include <system_error> |
| 21 |
|
| 22 |
#define TEST_ERRC(x) errc x(errc::x); (void)x |
| 23 |
|
| 24 |
void test01() |
| 25 |
{ |
| 26 |
using std::errc; |
| 27 |
|
| 28 |
TEST_ERRC(address_family_not_supported); |
| 29 |
TEST_ERRC(address_in_use); |
| 30 |
TEST_ERRC(address_not_available); |
| 31 |
TEST_ERRC(already_connected); |
| 32 |
TEST_ERRC(argument_list_too_long); |
| 33 |
TEST_ERRC(argument_out_of_domain); |
| 34 |
TEST_ERRC(bad_address); |
| 35 |
TEST_ERRC(bad_file_descriptor); |
| 36 |
|
| 37 |
#ifdef EBADMSG |
| 38 |
TEST_ERRC(bad_message); |
| 39 |
#endif |
| 40 |
|
| 41 |
TEST_ERRC(broken_pipe); |
| 42 |
TEST_ERRC(connection_aborted); |
| 43 |
TEST_ERRC(connection_already_in_progress); |
| 44 |
TEST_ERRC(connection_refused); |
| 45 |
TEST_ERRC(connection_reset); |
| 46 |
TEST_ERRC(cross_device_link); |
| 47 |
TEST_ERRC(destination_address_required); |
| 48 |
TEST_ERRC(device_or_resource_busy); |
| 49 |
TEST_ERRC(directory_not_empty); |
| 50 |
TEST_ERRC(executable_format_error); |
| 51 |
TEST_ERRC(file_exists); |
| 52 |
TEST_ERRC(file_too_large); |
| 53 |
TEST_ERRC(filename_too_long); |
| 54 |
TEST_ERRC(function_not_supported); |
| 55 |
TEST_ERRC(host_unreachable); |
| 56 |
|
| 57 |
#ifdef EIDRM |
| 58 |
TEST_ERRC(identifier_removed); |
| 59 |
#endif |
| 60 |
|
| 61 |
TEST_ERRC(illegal_byte_sequence); |
| 62 |
TEST_ERRC(inappropriate_io_control_operation); |
| 63 |
TEST_ERRC(interrupted); |
| 64 |
TEST_ERRC(invalid_argument); |
| 65 |
TEST_ERRC(invalid_seek); |
| 66 |
TEST_ERRC(io_error); |
| 67 |
TEST_ERRC(is_a_directory); |
| 68 |
TEST_ERRC(message_size); |
| 69 |
TEST_ERRC(network_down); |
| 70 |
TEST_ERRC(network_reset); |
| 71 |
TEST_ERRC(network_unreachable); |
| 72 |
TEST_ERRC(no_buffer_space); |
| 73 |
|
| 74 |
#ifdef ECHILD |
| 75 |
TEST_ERRC(no_child_process); |
| 76 |
#endif |
| 77 |
|
| 78 |
#ifdef ENOLINK |
| 79 |
TEST_ERRC(no_link); |
| 80 |
#endif |
| 81 |
|
| 82 |
TEST_ERRC(no_lock_available); |
| 83 |
|
| 84 |
#ifdef ENODATA |
| 85 |
TEST_ERRC(no_message_available); |
| 86 |
#endif |
| 87 |
|
| 88 |
#ifdef ENOMSG |
| 89 |
TEST_ERRC(no_message); |
| 90 |
#endif |
| 91 |
TEST_ERRC(no_protocol_option); |
| 92 |
|
| 93 |
#ifdef ENOSPC |
| 94 |
TEST_ERRC(no_space_on_device); |
| 95 |
#endif |
| 96 |
|
| 97 |
#ifdef ENOSR |
| 98 |
TEST_ERRC(no_stream_resources); |
| 99 |
#endif |
| 100 |
|
| 101 |
TEST_ERRC(no_such_device_or_address); |
| 102 |
TEST_ERRC(no_such_device); |
| 103 |
TEST_ERRC(no_such_file_or_directory); |
| 104 |
TEST_ERRC(no_such_process); |
| 105 |
TEST_ERRC(not_a_directory); |
| 106 |
TEST_ERRC(not_a_socket); |
| 107 |
|
| 108 |
#ifdef ENOSTR |
| 109 |
TEST_ERRC(not_a_stream); |
| 110 |
#endif |
| 111 |
|
| 112 |
TEST_ERRC(not_connected); |
| 113 |
TEST_ERRC(not_enough_memory); |
| 114 |
|
| 115 |
#ifdef ENOTSUP |
| 116 |
TEST_ERRC(not_supported); |
| 117 |
#endif |
| 118 |
|
| 119 |
#ifdef ECANCELED |
| 120 |
TEST_ERRC(operation_canceled); |
| 121 |
#endif |
| 122 |
|
| 123 |
TEST_ERRC(operation_in_progress); |
| 124 |
|
| 125 |
#ifdef EPERM |
| 126 |
TEST_ERRC(operation_not_permitted); |
| 127 |
#endif |
| 128 |
|
| 129 |
TEST_ERRC(operation_not_supported); |
| 130 |
|
| 131 |
#ifdef EWOULDBLOCK |
| 132 |
TEST_ERRC(operation_would_block); |
| 133 |
#endif |
| 134 |
|
| 135 |
#ifdef EOWNERDEAD |
| 136 |
TEST_ERRC(owner_dead); |
| 137 |
#endif |
| 138 |
|
| 139 |
TEST_ERRC(permission_denied); |
| 140 |
|
| 141 |
#ifdef EPROTO |
| 142 |
TEST_ERRC(protocol_error); |
| 143 |
#endif |
| 144 |
|
| 145 |
TEST_ERRC(protocol_not_supported); |
| 146 |
TEST_ERRC(read_only_file_system); |
| 147 |
TEST_ERRC(resource_deadlock_would_occur); |
| 148 |
TEST_ERRC(resource_unavailable_try_again); |
| 149 |
TEST_ERRC(result_out_of_range); |
| 150 |
|
| 151 |
#ifdef ENOTRECOVERABLE |
| 152 |
TEST_ERRC(state_not_recoverable); |
| 153 |
#endif |
| 154 |
|
| 155 |
#ifdef ETIME |
| 156 |
TEST_ERRC(stream_timeout); |
| 157 |
#endif |
| 158 |
|
| 159 |
#ifdef ETXTBSY |
| 160 |
TEST_ERRC(text_file_busy); |
| 161 |
#endif |
| 162 |
|
| 163 |
#ifdef ETIMEDOUT |
| 164 |
TEST_ERRC(timed_out); |
| 165 |
#endif |
| 166 |
|
| 167 |
TEST_ERRC(too_many_files_open_in_system); |
| 168 |
TEST_ERRC(too_many_files_open); |
| 169 |
TEST_ERRC(too_many_links); |
| 170 |
TEST_ERRC(too_many_symbolic_link_levels); |
| 171 |
|
| 172 |
#ifdef EOVERFLOW |
| 173 |
TEST_ERRC(value_too_large); |
| 174 |
#endif |
| 175 |
|
| 176 |
TEST_ERRC(wrong_protocol_type); |
| 177 |
} |