summaryrefslogtreecommitdiff
path: root/libstdc++-v3/testsuite/19_diagnostics/headers
diff options
context:
space:
mode:
authorupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
committerupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
commit554fd8c5195424bdbcabf5de30fdc183aba391bd (patch)
tree976dc5ab7fddf506dadce60ae936f43f58787092 /libstdc++-v3/testsuite/19_diagnostics/headers
downloadcbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.bz2
cbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.xz
obtained gcc-4.6.4.tar.bz2 from upstream website;upstream
verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository.
Diffstat (limited to 'libstdc++-v3/testsuite/19_diagnostics/headers')
-rw-r--r--libstdc++-v3/testsuite/19_diagnostics/headers/cassert/macros.cc27
-rw-r--r--libstdc++-v3/testsuite/19_diagnostics/headers/cerrno/macros.cc35
-rw-r--r--libstdc++-v3/testsuite/19_diagnostics/headers/stdexcept/synopsis.cc33
-rw-r--r--libstdc++-v3/testsuite/19_diagnostics/headers/stdexcept/types_std.cc33
-rw-r--r--libstdc++-v3/testsuite/19_diagnostics/headers/system_error/34538.cc28
-rw-r--r--libstdc++-v3/testsuite/19_diagnostics/headers/system_error/errc_std_c++0x.cc157
-rw-r--r--libstdc++-v3/testsuite/19_diagnostics/headers/system_error/std_c++0x_neg.cc25
-rw-r--r--libstdc++-v3/testsuite/19_diagnostics/headers/system_error/types_std_c++0x.cc29
8 files changed, 367 insertions, 0 deletions
diff --git a/libstdc++-v3/testsuite/19_diagnostics/headers/cassert/macros.cc b/libstdc++-v3/testsuite/19_diagnostics/headers/cassert/macros.cc
new file mode 100644
index 000000000..12ddd2799
--- /dev/null
+++ b/libstdc++-v3/testsuite/19_diagnostics/headers/cassert/macros.cc
@@ -0,0 +1,27 @@
+// { dg-do compile }
+
+// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <cassert>
+
+namespace gnu
+{
+#ifndef assert
+ #error "assert_must_be_a_macro"
+#endif
+}
diff --git a/libstdc++-v3/testsuite/19_diagnostics/headers/cerrno/macros.cc b/libstdc++-v3/testsuite/19_diagnostics/headers/cerrno/macros.cc
new file mode 100644
index 000000000..d82821b4f
--- /dev/null
+++ b/libstdc++-v3/testsuite/19_diagnostics/headers/cerrno/macros.cc
@@ -0,0 +1,35 @@
+// { dg-do compile }
+
+// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <cerrno>
+
+namespace gnu
+{
+#ifndef EDOM
+ #error "EDOM_must_be_a_macro"
+#endif
+
+#ifndef ERANGE
+ #error "ERANGE_must_be_a_macro"
+#endif
+
+#ifndef errno
+ #error "errno_must_be_a_macro"
+#endif
+}
diff --git a/libstdc++-v3/testsuite/19_diagnostics/headers/stdexcept/synopsis.cc b/libstdc++-v3/testsuite/19_diagnostics/headers/stdexcept/synopsis.cc
new file mode 100644
index 000000000..0035107bc
--- /dev/null
+++ b/libstdc++-v3/testsuite/19_diagnostics/headers/stdexcept/synopsis.cc
@@ -0,0 +1,33 @@
+// { dg-do compile }
+
+// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <stdexcept>
+
+namespace std {
+ class logic_error;
+ class domain_error;
+ class invalid_argument;
+ class length_error;
+ class out_of_range;
+ class runtime_error;
+ class range_error;
+ class overflow_error;
+ class underflow_error;
+}
+
diff --git a/libstdc++-v3/testsuite/19_diagnostics/headers/stdexcept/types_std.cc b/libstdc++-v3/testsuite/19_diagnostics/headers/stdexcept/types_std.cc
new file mode 100644
index 000000000..bff018b94
--- /dev/null
+++ b/libstdc++-v3/testsuite/19_diagnostics/headers/stdexcept/types_std.cc
@@ -0,0 +1,33 @@
+// { dg-do compile }
+
+// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <stdexcept>
+
+namespace gnu
+{
+ typedef std::logic_error t1;
+ typedef std::domain_error t2;
+ typedef std::invalid_argument t3;
+ typedef std::length_error t4;
+ typedef std::out_of_range t5;
+ typedef std::runtime_error t6;
+ typedef std::range_error t7;
+ typedef std::overflow_error t8;
+ typedef std::underflow_error t9;
+}
diff --git a/libstdc++-v3/testsuite/19_diagnostics/headers/system_error/34538.cc b/libstdc++-v3/testsuite/19_diagnostics/headers/system_error/34538.cc
new file mode 100644
index 000000000..e33a88e40
--- /dev/null
+++ b/libstdc++-v3/testsuite/19_diagnostics/headers/system_error/34538.cc
@@ -0,0 +1,28 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-do compile }
+
+// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <stdexcept>
+#include <system_error>
+
+// libstdc++/34538
+int main()
+{
+ throw std::invalid_argument("foo");
+}
diff --git a/libstdc++-v3/testsuite/19_diagnostics/headers/system_error/errc_std_c++0x.cc b/libstdc++-v3/testsuite/19_diagnostics/headers/system_error/errc_std_c++0x.cc
new file mode 100644
index 000000000..d480a09b8
--- /dev/null
+++ b/libstdc++-v3/testsuite/19_diagnostics/headers/system_error/errc_std_c++0x.cc
@@ -0,0 +1,157 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-do compile }
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <system_error>
+
+#define TEST_ERRC(x) errc x(errc::x); (void)x
+
+void test01()
+{
+ using std::errc;
+
+ TEST_ERRC(address_family_not_supported);
+ TEST_ERRC(address_in_use);
+ TEST_ERRC(address_not_available);
+ TEST_ERRC(already_connected);
+ TEST_ERRC(argument_list_too_long);
+ TEST_ERRC(argument_out_of_domain);
+ TEST_ERRC(bad_address);
+ TEST_ERRC(bad_file_descriptor);
+
+#ifdef _GLIBCXX_HAVE_EBADMSG
+ TEST_ERRC(bad_message);
+#endif
+
+ TEST_ERRC(broken_pipe);
+ TEST_ERRC(connection_aborted);
+ TEST_ERRC(connection_already_in_progress);
+ TEST_ERRC(connection_refused);
+ TEST_ERRC(connection_reset);
+ TEST_ERRC(cross_device_link);
+ TEST_ERRC(destination_address_required);
+ TEST_ERRC(device_or_resource_busy);
+ TEST_ERRC(directory_not_empty);
+ TEST_ERRC(executable_format_error);
+ TEST_ERRC(file_exists);
+ TEST_ERRC(file_too_large);
+ TEST_ERRC(filename_too_long);
+ TEST_ERRC(function_not_supported);
+ TEST_ERRC(host_unreachable);
+
+#ifdef _GLIBCXX_HAVE_EIDRM
+ TEST_ERRC(identifier_removed);
+#endif
+
+ TEST_ERRC(illegal_byte_sequence);
+ TEST_ERRC(inappropriate_io_control_operation);
+ TEST_ERRC(interrupted);
+ TEST_ERRC(invalid_argument);
+ TEST_ERRC(invalid_seek);
+ TEST_ERRC(io_error);
+ TEST_ERRC(is_a_directory);
+ TEST_ERRC(message_size);
+ TEST_ERRC(network_down);
+ TEST_ERRC(network_reset);
+ TEST_ERRC(network_unreachable);
+ TEST_ERRC(no_buffer_space);
+ TEST_ERRC(no_child_process);
+
+#ifdef _GLIBCXX_HAVE_ENOLINK
+ TEST_ERRC(no_link);
+#endif
+
+ TEST_ERRC(no_lock_available);
+
+#ifdef _GLIBCXX_HAVE_ENODATA
+ TEST_ERRC(no_message_available);
+#endif
+
+ TEST_ERRC(no_message);
+ TEST_ERRC(no_protocol_option);
+ TEST_ERRC(no_space_on_device);
+
+#ifdef _GLIBCXX_HAVE_ENOSR
+ TEST_ERRC(no_stream_resources);
+#endif
+
+ TEST_ERRC(no_such_device_or_address);
+ TEST_ERRC(no_such_device);
+ TEST_ERRC(no_such_file_or_directory);
+ TEST_ERRC(no_such_process);
+ TEST_ERRC(not_a_directory);
+ TEST_ERRC(not_a_socket);
+
+#ifdef _GLIBCXX_HAVE_ENOSTR
+ TEST_ERRC(not_a_stream);
+#endif
+
+ TEST_ERRC(not_connected);
+ TEST_ERRC(not_enough_memory);
+ TEST_ERRC(not_supported);
+
+#ifdef _GLIBCXX_HAVE_ECANCELED
+ TEST_ERRC(operation_canceled);
+#endif
+
+ TEST_ERRC(operation_in_progress);
+ TEST_ERRC(operation_not_permitted);
+ TEST_ERRC(operation_not_supported);
+ TEST_ERRC(operation_would_block);
+
+#ifdef _GLIBCXX_HAVE_EOWNERDEAD
+ TEST_ERRC(owner_dead);
+#endif
+
+ TEST_ERRC(permission_denied);
+
+#ifdef _GLIBCXX_HAVE_EPROTO
+ TEST_ERRC(protocol_error);
+#endif
+
+ TEST_ERRC(protocol_not_supported);
+ TEST_ERRC(read_only_file_system);
+ TEST_ERRC(resource_deadlock_would_occur);
+ TEST_ERRC(resource_unavailable_try_again);
+ TEST_ERRC(result_out_of_range);
+
+#ifdef _GLIBCXX_HAVE_ENOTRECOVERABLE
+ TEST_ERRC(state_not_recoverable);
+#endif
+
+#ifdef _GLIBCXX_HAVE_ETIME
+ TEST_ERRC(stream_timeout);
+#endif
+
+#ifdef _GLIBCXX_HAVE_ETXTBSY
+ TEST_ERRC(text_file_busy);
+#endif
+
+ TEST_ERRC(timed_out);
+ TEST_ERRC(too_many_files_open_in_system);
+ TEST_ERRC(too_many_files_open);
+ TEST_ERRC(too_many_links);
+ TEST_ERRC(too_many_symbolic_link_levels);
+
+#ifdef _GLIBCXX_HAVE_EOVERFLOW
+ TEST_ERRC(value_too_large);
+#endif
+
+ TEST_ERRC(wrong_protocol_type);
+}
diff --git a/libstdc++-v3/testsuite/19_diagnostics/headers/system_error/std_c++0x_neg.cc b/libstdc++-v3/testsuite/19_diagnostics/headers/system_error/std_c++0x_neg.cc
new file mode 100644
index 000000000..9698cf031
--- /dev/null
+++ b/libstdc++-v3/testsuite/19_diagnostics/headers/system_error/std_c++0x_neg.cc
@@ -0,0 +1,25 @@
+// { dg-do compile }
+
+// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <system_error>
+
+// { dg-error "upcoming ISO" "" { target *-*-* } 32 }
+
+
+
diff --git a/libstdc++-v3/testsuite/19_diagnostics/headers/system_error/types_std_c++0x.cc b/libstdc++-v3/testsuite/19_diagnostics/headers/system_error/types_std_c++0x.cc
new file mode 100644
index 000000000..f124e04ff
--- /dev/null
+++ b/libstdc++-v3/testsuite/19_diagnostics/headers/system_error/types_std_c++0x.cc
@@ -0,0 +1,29 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-do compile }
+
+// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <system_error>
+
+namespace gnu
+{
+ using std::system_error;
+ using std::error_code;
+ using std::error_category;
+ using std::system_category;
+}