summaryrefslogtreecommitdiff
path: root/libstdc++-v3/testsuite/17_intro/headers/c++2011
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2015-09-11 13:25:43 +0100
committerJonathan Wakely <redi@gcc.gnu.org>2015-09-11 13:25:43 +0100
commitf12ddb6249f83e89a323296cd561da85bcc57d8b (patch)
tree6f8af6704b3bebed94fc0bcfe4f8c40fccc8c03c /libstdc++-v3/testsuite/17_intro/headers/c++2011
parentf5548c3916db31efbcef3247dc72ed43ad182095 (diff)
downloadgcc-f12ddb6249f83e89a323296cd561da85bcc57d8b.tar.gz
Rationalise PCH headers and 17_intro/headers tests.
PR libstdc++/64857 * doc/xml/manual/using.xml: Improve aggregate header documentation. * doc/html/manual/*: Regenerate. * include/precompiled/extc++.h: Include <bits/stdc++.h> for C++11 and later and include more extension headers. * testsuite/17_intro/headers/c++1998/all_attributes.cc: Remove redundant header. * testsuite/17_intro/headers/c++200x/: Rename to c++2011. * testsuite/17_intro/headers/c++2014/all_attributes.cc: Remove redundant headers. * testsuite/17_intro/headers/c++2014/all_no_exceptions.cc: New. * testsuite/17_intro/headers/c++2014/all_no_rtti.cc: New. * testsuite/17_intro/headers/c++2014/all_pedantic_errors.cc: New. * testsuite/17_intro/headers/c++2014/operator_names.cc: New. * testsuite/17_intro/headers/c++2014/stdc++.cc: New. * testsuite/17_intro/headers/c++2014/stdc++_multiple_inclusion.cc: New. From-SVN: r227684
Diffstat (limited to 'libstdc++-v3/testsuite/17_intro/headers/c++2011')
-rw-r--r--libstdc++-v3/testsuite/17_intro/headers/c++2011/42319.cc22
-rw-r--r--libstdc++-v3/testsuite/17_intro/headers/c++2011/67309.cc22
-rw-r--r--libstdc++-v3/testsuite/17_intro/headers/c++2011/all_attributes.cc42
-rw-r--r--libstdc++-v3/testsuite/17_intro/headers/c++2011/all_no_exceptions.cc21
-rw-r--r--libstdc++-v3/testsuite/17_intro/headers/c++2011/all_no_rtti.cc21
-rw-r--r--libstdc++-v3/testsuite/17_intro/headers/c++2011/all_pedantic_errors.cc21
-rw-r--r--libstdc++-v3/testsuite/17_intro/headers/c++2011/operator_names.cc30
-rw-r--r--libstdc++-v3/testsuite/17_intro/headers/c++2011/stdc++.cc70
-rw-r--r--libstdc++-v3/testsuite/17_intro/headers/c++2011/stdc++_multiple_inclusion.cc117
9 files changed, 366 insertions, 0 deletions
diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++2011/42319.cc b/libstdc++-v3/testsuite/17_intro/headers/c++2011/42319.cc
new file mode 100644
index 00000000000..65afb572148
--- /dev/null
+++ b/libstdc++-v3/testsuite/17_intro/headers/c++2011/42319.cc
@@ -0,0 +1,22 @@
+// { dg-do compile }
+// { dg-options "-std=gnu++11" }
+
+// Copyright (C) 2009-2015 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/>.
+
+// libstdc++/42319
+#include <bits/char_traits.h>
diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++2011/67309.cc b/libstdc++-v3/testsuite/17_intro/headers/c++2011/67309.cc
new file mode 100644
index 00000000000..409b38da59f
--- /dev/null
+++ b/libstdc++-v3/testsuite/17_intro/headers/c++2011/67309.cc
@@ -0,0 +1,22 @@
+// Copyright (C) 2015 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/>.
+
+// { dg-options "-std=gnu++11 -fsingle-precision-constant" }
+// { dg-do compile }
+
+// libstdc++/67309
+#include <bits/extc++.h>
diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++2011/all_attributes.cc b/libstdc++-v3/testsuite/17_intro/headers/c++2011/all_attributes.cc
new file mode 100644
index 00000000000..8c3d0078576
--- /dev/null
+++ b/libstdc++-v3/testsuite/17_intro/headers/c++2011/all_attributes.cc
@@ -0,0 +1,42 @@
+// Copyright (C) 2015 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/>.
+
+// { dg-options "-std=gnu++11" }
+// { dg-do compile }
+
+// Ensure the library only uses the __name__ form for attributes.
+// Don't test 'const' and 'noreturn' because they are reserved anyway.
+#define abi_tag 1
+#define always_inline 1
+#ifndef __APPLE__
+// darwin headers use these, see PR 64883
+# define visibility 1
+# define deprecated 1
+#endif
+#define packed 1
+#define pure 1
+// glibc's sysdeps/unix/sysv/linux/arm/sys/ucontext.h uses this on ARM.
+#ifndef __arm__
+#define unused 1
+#endif
+
+#include <bits/extc++.h>
+
+int
+main()
+{
+}
diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++2011/all_no_exceptions.cc b/libstdc++-v3/testsuite/17_intro/headers/c++2011/all_no_exceptions.cc
new file mode 100644
index 00000000000..13158d121bd
--- /dev/null
+++ b/libstdc++-v3/testsuite/17_intro/headers/c++2011/all_no_exceptions.cc
@@ -0,0 +1,21 @@
+// { dg-do compile }
+// { dg-options "-std=gnu++11 -fno-exceptions" }
+
+// Copyright (C) 2007-2015 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 <bits/extc++.h>
diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++2011/all_no_rtti.cc b/libstdc++-v3/testsuite/17_intro/headers/c++2011/all_no_rtti.cc
new file mode 100644
index 00000000000..7bbc25f0435
--- /dev/null
+++ b/libstdc++-v3/testsuite/17_intro/headers/c++2011/all_no_rtti.cc
@@ -0,0 +1,21 @@
+// { dg-do compile }
+// { dg-options "-std=gnu++11 -fno-rtti" }
+
+// Copyright (C) 2010-2015 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 <bits/extc++.h>
diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++2011/all_pedantic_errors.cc b/libstdc++-v3/testsuite/17_intro/headers/c++2011/all_pedantic_errors.cc
new file mode 100644
index 00000000000..ad5847eb7df
--- /dev/null
+++ b/libstdc++-v3/testsuite/17_intro/headers/c++2011/all_pedantic_errors.cc
@@ -0,0 +1,21 @@
+// { dg-do compile }
+// { dg-options "-std=gnu++11 -pedantic-errors" }
+
+// Copyright (C) 2007-2015 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 <bits/extc++.h>
diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++2011/operator_names.cc b/libstdc++-v3/testsuite/17_intro/headers/c++2011/operator_names.cc
new file mode 100644
index 00000000000..028c2efbcf7
--- /dev/null
+++ b/libstdc++-v3/testsuite/17_intro/headers/c++2011/operator_names.cc
@@ -0,0 +1,30 @@
+// { dg-do compile }
+// { dg-options "-std=gnu++11 -fno-operator-names" }
+
+// Copyright (C) 2011-2015 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/>.
+
+// libstdc++/47662
+
+// Avoid using PCH
+#include <cerrno>
+#include <bits/stdc++.h>
+#include <bits/stdtr1c++.h>
+#include <bits/extc++.h>
+
+int or, xor, and;
+
diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++2011/stdc++.cc b/libstdc++-v3/testsuite/17_intro/headers/c++2011/stdc++.cc
new file mode 100644
index 00000000000..d1c64b190a8
--- /dev/null
+++ b/libstdc++-v3/testsuite/17_intro/headers/c++2011/stdc++.cc
@@ -0,0 +1,70 @@
+// FreeBSD wants warning clean system headers:
+// { dg-options "-Wall -Wsystem-headers" { target *-*-freebsd* *-*-dragonfly* } }
+// { dg-options "-std=gnu++11" }
+// { dg-do compile }
+
+// Copyright (C) 2007-2015 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/>.
+
+// 17.4.1.2 Headers
+
+#include <bits/stdc++.h>
+
+// "C" compatibility headers
+#include <assert.h>
+#ifdef _GLIBCXX_HAVE_COMPLEX_H
+#include <complex.h>
+#endif
+#include <ctype.h>
+#include <errno.h>
+#ifdef _GLIBCXX_HAVE_FENV_H
+#include <fenv.h>
+#endif
+#include <float.h>
+#ifdef _GLIBCXX_HAVE_INTTYPES_H
+#include <inttypes.h>
+#endif
+#include <iso646.h>
+#include <limits.h>
+#include <locale.h>
+#include <math.h>
+#include <setjmp.h>
+#include <signal.h>
+#include <stdarg.h>
+#ifdef _GLIBCXX_HAVE_STDBOOL_H
+#include <stdbool.h>
+#endif
+#include <stddef.h>
+#ifdef _GLIBCXX_HAVE_STDINT_H
+#include <stdint.h>
+#endif
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#ifdef _GLIBCXX_HAVE_TGMATH_H
+#include <tgmath.h>
+#endif
+#include <time.h>
+#if __has_include(<uchar.h>)
+#include <uchar.h>
+#endif
+#ifdef _GLIBCXX_HAVE_WCHAR_H
+#include <wchar.h>
+#endif
+#ifdef _GLIBCXX_HAVE_WCTYPE_H
+#include <wctype.h>
+#endif
diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++2011/stdc++_multiple_inclusion.cc b/libstdc++-v3/testsuite/17_intro/headers/c++2011/stdc++_multiple_inclusion.cc
new file mode 100644
index 00000000000..e51bdee70f6
--- /dev/null
+++ b/libstdc++-v3/testsuite/17_intro/headers/c++2011/stdc++_multiple_inclusion.cc
@@ -0,0 +1,117 @@
+// FreeBSD wants warning clean system headers:
+// { dg-options "-Wall -Wsystem-headers" { target *-*-freebsd* *-*-dragonfly* } }
+// { dg-options "-std=gnu++11" }
+// { dg-do compile }
+
+// Copyright (C) 2007-2015 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/>.
+
+// 17.4.1.2 Headers
+
+#include <bits/stdc++.h>
+
+// "C" compatibility headers
+#include <assert.h>
+#ifdef _GLIBCXX_HAVE_COMPLEX_H
+#include <complex.h>
+#endif
+#include <ctype.h>
+#include <errno.h>
+#ifdef _GLIBCXX_HAVE_FENV_H
+#include <fenv.h>
+#endif
+#include <float.h>
+#ifdef _GLIBCXX_HAVE_INTTYPES_H
+#include <inttypes.h>
+#endif
+#include <iso646.h>
+#include <limits.h>
+#include <locale.h>
+#include <math.h>
+#include <setjmp.h>
+#include <signal.h>
+#include <stdarg.h>
+#ifdef _GLIBCXX_HAVE_STDBOOL_H
+#include <stdbool.h>
+#endif
+#include <stddef.h>
+#ifdef _GLIBCXX_HAVE_STDINT_H
+#include <stdint.h>
+#endif
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#ifdef _GLIBCXX_HAVE_TGMATH_H
+#include <tgmath.h>
+#endif
+#include <time.h>
+#if __has_include(<uchar.h>)
+#include <uchar.h>
+#endif
+#ifdef _GLIBCXX_HAVE_WCHAR_H
+#include <wchar.h>
+#endif
+#ifdef _GLIBCXX_HAVE_WCTYPE_H
+#include <wctype.h>
+#endif
+
+#include <bits/stdc++.h>
+
+// "C" compatibility headers
+#include <assert.h>
+#ifdef _GLIBCXX_HAVE_COMPLEX_H
+#include <complex.h>
+#endif
+#include <ctype.h>
+#include <errno.h>
+#ifdef _GLIBCXX_HAVE_FENV_H
+#include <fenv.h>
+#endif
+#include <float.h>
+#ifdef _GLIBCXX_HAVE_INTTYPES_H
+#include <inttypes.h>
+#endif
+#include <iso646.h>
+#include <limits.h>
+#include <locale.h>
+#include <math.h>
+#include <setjmp.h>
+#include <signal.h>
+#include <stdarg.h>
+#ifdef _GLIBCXX_HAVE_STDBOOL_H
+#include <stdbool.h>
+#endif
+#include <stddef.h>
+#ifdef _GLIBCXX_HAVE_STDINT_H
+#include <stdint.h>
+#endif
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#ifdef _GLIBCXX_HAVE_TGMATH_H
+#include <tgmath.h>
+#endif
+#include <time.h>
+#if __has_include(<uchar.h>)
+#include <uchar.h>
+#endif
+#ifdef _GLIBCXX_HAVE_WCHAR_H
+#include <wchar.h>
+#endif
+#ifdef _GLIBCXX_HAVE_WCTYPE_H
+#include <wctype.h>
+#endif