From: No Author Date: Sun, 1 May 2005 10:39:15 +0000 (+0000) Subject: This commit was manufactured by cvs2svn to create branch X-Git-Tag: releases/gcc-3.4.4~59 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ab6ea560bf7f505860cd8c634b0eaa565755c960;p=thirdparty%2Fgcc.git This commit was manufactured by cvs2svn to create branch 'gcc-3_4-branch'. From-SVN: r99061 --- diff --git a/gcc/testsuite/gcc.dg/format/asm_fprintf-2.c b/gcc/testsuite/gcc.dg/format/asm_fprintf-2.c new file mode 100644 index 000000000000..847eeee282f5 --- /dev/null +++ b/gcc/testsuite/gcc.dg/format/asm_fprintf-2.c @@ -0,0 +1,9 @@ +/* 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 */ +/* { 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" } */ diff --git a/gcc/testsuite/gcc.dg/format/asm_fprintf-3.c b/gcc/testsuite/gcc.dg/format/asm_fprintf-3.c new file mode 100644 index 000000000000..f5fd5c022fc3 --- /dev/null +++ b/gcc/testsuite/gcc.dg/format/asm_fprintf-3.c @@ -0,0 +1,10 @@ +/* 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 */ +/* { 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" } */ diff --git a/gcc/testsuite/gcc.dg/format/asm_fprintf-4.c b/gcc/testsuite/gcc.dg/format/asm_fprintf-4.c new file mode 100644 index 000000000000..9de05134af3d --- /dev/null +++ b/gcc/testsuite/gcc.dg/format/asm_fprintf-4.c @@ -0,0 +1,10 @@ +/* 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 */ +/* { 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" } */ diff --git a/gcc/testsuite/gcc.dg/format/asm_fprintf-5.c b/gcc/testsuite/gcc.dg/format/asm_fprintf-5.c new file mode 100644 index 000000000000..14ffb60d32e7 --- /dev/null +++ b/gcc/testsuite/gcc.dg/format/asm_fprintf-5.c @@ -0,0 +1,10 @@ +/* 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 */ +/* { 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'" } */ diff --git a/gcc/testsuite/gcc.dg/format/gcc_diag-2.c b/gcc/testsuite/gcc.dg/format/gcc_diag-2.c new file mode 100644 index 000000000000..60c6835da9e5 --- /dev/null +++ b/gcc/testsuite/gcc.dg/format/gcc_diag-2.c @@ -0,0 +1,10 @@ +/* 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 */ +/* { dg-do compile } */ +/* { dg-options "-Wformat" } */ + +void foo (int tree); +void bar (const char *, ...) __attribute__ ((__format__ (__gcc_diag__, 1, 2))); diff --git a/gcc/testsuite/gcc.dg/format/gcc_diag-3.c b/gcc/testsuite/gcc.dg/format/gcc_diag-3.c new file mode 100644 index 000000000000..1a7848ed9f25 --- /dev/null +++ b/gcc/testsuite/gcc.dg/format/gcc_diag-3.c @@ -0,0 +1,10 @@ +/* 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 */ +/* { 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" } */ diff --git a/gcc/testsuite/gcc.dg/format/gcc_diag-4.c b/gcc/testsuite/gcc.dg/format/gcc_diag-4.c new file mode 100644 index 000000000000..20661c41f71a --- /dev/null +++ b/gcc/testsuite/gcc.dg/format/gcc_diag-4.c @@ -0,0 +1,10 @@ +/* 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 */ +/* { 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" } */ diff --git a/gcc/testsuite/gcc.dg/format/gcc_diag-5.c b/gcc/testsuite/gcc.dg/format/gcc_diag-5.c new file mode 100644 index 000000000000..f8f12d68cdd0 --- /dev/null +++ b/gcc/testsuite/gcc.dg/format/gcc_diag-5.c @@ -0,0 +1,10 @@ +/* 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 */ +/* { dg-do compile } */ +/* { dg-options "-Wformat" } */ + +void foo (int location_t); +void bar (const char *, ...) __attribute__ ((__format__ (__gcc_diag__, 1, 2))); diff --git a/gcc/testsuite/gcc.dg/format/gcc_diag-6.c b/gcc/testsuite/gcc.dg/format/gcc_diag-6.c new file mode 100644 index 000000000000..fdb493d4973c --- /dev/null +++ b/gcc/testsuite/gcc.dg/format/gcc_diag-6.c @@ -0,0 +1,10 @@ +/* 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 */ +/* { 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" } */ diff --git a/gcc/testsuite/gcc.dg/format/gcc_diag-7.c b/gcc/testsuite/gcc.dg/format/gcc_diag-7.c new file mode 100644 index 000000000000..fccf5d240412 --- /dev/null +++ b/gcc/testsuite/gcc.dg/format/gcc_diag-7.c @@ -0,0 +1,10 @@ +/* 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 */ +/* { dg-do compile } */ +/* { dg-options "-Wformat" } */ + +void foo (int __gcc_host_wide_int__); +void bar (const char *, ...) __attribute__ ((__format__ (__gcc_diag__, 1, 2))); diff --git a/gcc/testsuite/gcc.dg/format/gcc_diag-8.c b/gcc/testsuite/gcc.dg/format/gcc_diag-8.c new file mode 100644 index 000000000000..835ec3f98d34 --- /dev/null +++ b/gcc/testsuite/gcc.dg/format/gcc_diag-8.c @@ -0,0 +1,10 @@ +/* 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 */ +/* { 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" } */ diff --git a/gcc/testsuite/gcc.dg/format/gcc_diag-9.c b/gcc/testsuite/gcc.dg/format/gcc_diag-9.c new file mode 100644 index 000000000000..6481c26caf77 --- /dev/null +++ b/gcc/testsuite/gcc.dg/format/gcc_diag-9.c @@ -0,0 +1,10 @@ +/* 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 */ +/* { 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'" } */ diff --git a/gcc/testsuite/gcc.dg/transparent-union-3.c b/gcc/testsuite/gcc.dg/transparent-union-3.c new file mode 100644 index 000000000000..cebd5f857716 --- /dev/null +++ b/gcc/testsuite/gcc.dg/transparent-union-3.c @@ -0,0 +1,22 @@ +/* Test for ICEs on invalid transparent unions (empty or no named + members). Bug 21213. */ +/* Origin: Joseph Myers */ +/* { 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 } */ diff --git a/libstdc++-v3/testsuite/libstdc++-abi/abi.exp b/libstdc++-v3/testsuite/libstdc++-abi/abi.exp new file mode 100644 index 000000000000..f226e0aaf775 --- /dev/null +++ b/libstdc++-v3/testsuite/libstdc++-abi/abi.exp @@ -0,0 +1,43 @@ +# 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"