'gcc-3_4-branch'.
From-SVN: r99061
--- /dev/null
+/* Test for ICE handling internal formats: bug 20740. The code did
+ not check that, if the required typedef names had been used as
+ identifiers, they were defined to suitable types. Test
+ "__gcc_host_wide_int__", not used at all, asm_fprintf format. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-Wformat" } */
+
+void bar (const char *, ...) __attribute__ ((__format__ (__asm_fprintf__, 1, 2))); /* { dg-error "error: '__gcc_host_wide_int__' is not defined as a type" } */
--- /dev/null
+/* Test for ICE handling internal formats: bug 20740. The code did
+ not check that, if the required typedef names had been used as
+ identifiers, they were defined to suitable types. Test
+ "__gcc_host_wide_int__", not defined, asm_fprintf format. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-Wformat" } */
+
+void foo (int __gcc_host_wide_int__);
+void bar (const char *, ...) __attribute__ ((__format__ (__asm_fprintf__, 1, 2))); /* { dg-error "error: '__gcc_host_wide_int__' is not defined as a type" } */
--- /dev/null
+/* Test for ICE handling internal formats: bug 20740. The code did
+ not check that, if the required typedef names had been used as
+ identifiers, they were defined to suitable types. Test
+ "__gcc_host_wide_int__", not a type, asm_fprintf. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-Wformat" } */
+
+int __gcc_host_wide_int__;
+void bar (const char *, ...) __attribute__ ((__format__ (__asm_fprintf__, 1, 2))); /* { dg-error "error: '__gcc_host_wide_int__' is not defined as a type" } */
--- /dev/null
+/* Test for ICE handling internal formats: bug 20740. The code did
+ not check that, if the required typedef names had been used as
+ identifiers, they were defined to suitable types. Test
+ "__gcc_host_wide_int__", bad type, asm_fprintf format. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-Wformat" } */
+
+typedef int __gcc_host_wide_int__;
+void bar (const char *, ...) __attribute__ ((__format__ (__asm_fprintf__, 1, 2))); /* { dg-error "error: '__gcc_host_wide_int__' is not defined as 'long' or 'long long'" } */
--- /dev/null
+/* Test for ICE handling internal formats: bug 20740. The code did
+ not check that, if the required typedef names had been used as
+ identifiers, they were defined to suitable types. Test "tree", not
+ defined. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-Wformat" } */
+
+void foo (int tree);
+void bar (const char *, ...) __attribute__ ((__format__ (__gcc_diag__, 1, 2)));
--- /dev/null
+/* Test for ICE handling internal formats: bug 20740. The code did
+ not check that, if the required typedef names had been used as
+ identifiers, they were defined to suitable types. Test "tree", not
+ a type. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-Wformat" } */
+
+int tree;
+void bar (const char *, ...) __attribute__ ((__format__ (__gcc_diag__, 1, 2))); /* { dg-error "error: 'tree' is not defined as a type" } */
--- /dev/null
+/* Test for ICE handling internal formats: bug 20740. The code did
+ not check that, if the required typedef names had been used as
+ identifiers, they were defined to suitable types. Test "tree", not
+ a pointer type. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-Wformat" } */
+
+typedef int tree;
+void bar (const char *, ...) __attribute__ ((__format__ (__gcc_diag__, 1, 2))); /* { dg-error "error: 'tree' is not defined as a pointer type" } */
--- /dev/null
+/* Test for ICE handling internal formats: bug 20740. The code did
+ not check that, if the required typedef names had been used as
+ identifiers, they were defined to suitable types. Test
+ "location_t", not defined. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-Wformat" } */
+
+void foo (int location_t);
+void bar (const char *, ...) __attribute__ ((__format__ (__gcc_diag__, 1, 2)));
--- /dev/null
+/* Test for ICE handling internal formats: bug 20740. The code did
+ not check that, if the required typedef names had been used as
+ identifiers, they were defined to suitable types. Test
+ "location_t", not a type. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-Wformat" } */
+
+int location_t;
+void bar (const char *, ...) __attribute__ ((__format__ (__gcc_diag__, 1, 2))); /* { dg-error "error: 'location_t' is not defined as a type" } */
--- /dev/null
+/* Test for ICE handling internal formats: bug 20740. The code did
+ not check that, if the required typedef names had been used as
+ identifiers, they were defined to suitable types. Test
+ "__gcc_host_wide_int__", not defined. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-Wformat" } */
+
+void foo (int __gcc_host_wide_int__);
+void bar (const char *, ...) __attribute__ ((__format__ (__gcc_diag__, 1, 2)));
--- /dev/null
+/* Test for ICE handling internal formats: bug 20740. The code did
+ not check that, if the required typedef names had been used as
+ identifiers, they were defined to suitable types. Test
+ "__gcc_host_wide_int__", not a type. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-Wformat" } */
+
+int __gcc_host_wide_int__;
+void bar (const char *, ...) __attribute__ ((__format__ (__gcc_diag__, 1, 2))); /* { dg-error "error: '__gcc_host_wide_int__' is not defined as a type" } */
--- /dev/null
+/* Test for ICE handling internal formats: bug 20740. The code did
+ not check that, if the required typedef names had been used as
+ identifiers, they were defined to suitable types. Test
+ "__gcc_host_wide_int__", bad type. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-Wformat" } */
+
+typedef int __gcc_host_wide_int__;
+void bar (const char *, ...) __attribute__ ((__format__ (__gcc_diag__, 1, 2))); /* { dg-error "error: '__gcc_host_wide_int__' is not defined as 'long' or 'long long'" } */
--- /dev/null
+/* Test for ICEs on invalid transparent unions (empty or no named
+ members). Bug 21213. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+enum e { A };
+
+union __attribute__((__transparent_union__)) ue1 { enum e; }; /* { dg-warning "warning: declaration does not declare anything" } */
+/* { dg-warning "warning: union cannot be made transparent" "" { target *-*-* } 9 } */
+union ue2 { enum e; } __attribute__((__transparent_union__)); /* { dg-warning "warning: declaration does not declare anything" } */
+/* { dg-warning "warning: union cannot be made transparent" "" { target *-*-* } 11 } */
+
+union __attribute__((__transparent_union__)) ui1 { int; }; /* { dg-warning "warning: declaration does not declare anything" } */
+/* { dg-warning "warning: union cannot be made transparent" "" { target *-*-* } 14 } */
+union ui2 { int; } __attribute__((__transparent_union__)); /* { dg-warning "warning: declaration does not declare anything" } */
+/* { dg-warning "warning: union cannot be made transparent" "" { target *-*-* } 16 } */
+
+union __attribute__((__transparent_union__)) u1 { };
+/* { dg-warning "warning: union cannot be made transparent" "" { target *-*-* } 19 } */
+union u2 { } __attribute__((__transparent_union__));
+/* { dg-warning "warning: union cannot be made transparent" "" { target *-*-* } 21 } */
--- /dev/null
+# Copyright (C) 2005 Free Software Foundation, Inc.
+#
+# This program 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 2 of the License, or
+# (at your option) any later version.
+#
+# This program 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 program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# If there is no baseline file, or we can't find the library, skip
+# this test.
+if { ![info exists baseline_file] \
+ || ![file exists $baseline_file] \
+ || ![file exists "../src/.libs/libstdc++.so"] } {
+ return
+}
+
+# Figure out what symbols are defined by the active build of the library.
+remote_exec "build" "$srcdir/../scripts/extract_symvers" \
+ [list "../src/.libs/libstdc++.so" "current_symbols.txt"]
+
+# Build the support objects.
+v3-build_support
+
+# Build the abi_check program.
+if { [v3_target_compile "$srcdir/testsuite_abi_check.cc" "abi_check" \
+ "executable" [list "additional_flags=-w"]] != "" } {
+ error "could not compile testsuite_abi_check.cc"
+}
+
+remote_download "target" $baseline_file "baseline_symbols.txt"
+remote_download "target" "current_symbols.txt" "current_symbols.txt"
+set result [${tool}_load "./abi_check" \
+ [list "--check-verbose" "current_symbols.txt" \
+ "baseline_symbols.txt"]]
+[lindex $result 0] "abi_check"