From 554fd8c5195424bdbcabf5de30fdc183aba391bd Mon Sep 17 00:00:00 2001 From: upstream source tree Date: Sun, 15 Mar 2015 20:14:05 -0400 Subject: obtained gcc-4.6.4.tar.bz2 from upstream website; 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. --- gcc/testsuite/g++.old-deja/g++.warn/cast-align1.C | 27 +++++++++ gcc/testsuite/g++.old-deja/g++.warn/flow1.C | 14 +++++ gcc/testsuite/g++.old-deja/g++.warn/impint.C | 56 ++++++++++++++++++ gcc/testsuite/g++.old-deja/g++.warn/impint2.C | 69 +++++++++++++++++++++++ gcc/testsuite/g++.old-deja/g++.warn/inline.C | 69 +++++++++++++++++++++++ gcc/testsuite/g++.old-deja/g++.warn/iomanip.C | 13 +++++ gcc/testsuite/g++.old-deja/g++.warn/virt1.C | 10 ++++ 7 files changed, 258 insertions(+) create mode 100644 gcc/testsuite/g++.old-deja/g++.warn/cast-align1.C create mode 100644 gcc/testsuite/g++.old-deja/g++.warn/flow1.C create mode 100644 gcc/testsuite/g++.old-deja/g++.warn/impint.C create mode 100644 gcc/testsuite/g++.old-deja/g++.warn/impint2.C create mode 100644 gcc/testsuite/g++.old-deja/g++.warn/inline.C create mode 100644 gcc/testsuite/g++.old-deja/g++.warn/iomanip.C create mode 100644 gcc/testsuite/g++.old-deja/g++.warn/virt1.C (limited to 'gcc/testsuite/g++.old-deja/g++.warn') diff --git a/gcc/testsuite/g++.old-deja/g++.warn/cast-align1.C b/gcc/testsuite/g++.old-deja/g++.warn/cast-align1.C new file mode 100644 index 000000000..43cecab23 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.warn/cast-align1.C @@ -0,0 +1,27 @@ +// { dg-do assemble { target sparc-*-* } } +// { dg-options "-ansi -pedantic-errors -Wcast-align" } + + +// Copyright (C) 1999 Free Software Foundation, Inc. +// Contributed by Nathan Sidwell 7 Dec 1999 + +// converting a T * to void * does not need a complete T, and doesn't +// increase alignment requirements. + +struct X; +struct Y; +struct Z {double m;}; + +void f3 (X *xp, Z *zp) +{ + (void *)xp; + (void *)zp; + (Y *)xp; + (Y *)zp; + (Z *)xp; +} + +void f4 (char *ptr) +{ + (Z *)ptr; // { dg-warning "" } alignment +} diff --git a/gcc/testsuite/g++.old-deja/g++.warn/flow1.C b/gcc/testsuite/g++.old-deja/g++.warn/flow1.C new file mode 100644 index 000000000..61f6a5549 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.warn/flow1.C @@ -0,0 +1,14 @@ +// { dg-do assemble } +// { dg-options "-Wreturn-type" } +// Test that we don't get a warning about flowing off the end. + +struct A { + ~A (); +}; + +int f() +{ + A a1[2]; + A a2[2]; + return 1234567; +} diff --git a/gcc/testsuite/g++.old-deja/g++.warn/impint.C b/gcc/testsuite/g++.old-deja/g++.warn/impint.C new file mode 100644 index 000000000..1c7f0eb66 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.warn/impint.C @@ -0,0 +1,56 @@ +// { dg-do assemble } +// { dg-options "-Wconversion" } +// Copyright (C) 2000 Free Software Foundation, Inc. +// Contributed by Nathan Sidwell 24 Feb 2000 + +// derived from a bug report by Johan Kuipers +// initialization to 'int' from to 'double' We expect consistent warnings +// whenever a float is implicitly truncated to int + +struct X +{ + X (int); + X (int, int); +}; + +void foo (int); +void wibble (int); +void wibble (int, int); +void punk (int = 3.5); +void rock (); +void rock (int, int = 3.5); + +void fn () +{ + X x1(3.5); // { dg-warning "" } double to int + X x2(3.5f); // { dg-warning "" } float to int + X x3(1, 3.5); // { dg-warning "" } double to int + X x4(1, 3.5f); // { dg-warning "" } float to int + X x5(3.5, 1); // { dg-warning "" } double to int + X x6(3.5f, 1); // { dg-warning "" } float to int + + X y1 = 3.5; // { dg-warning "" } double to int + X y2 = 3.5f; // { dg-warning "" } float to int + + int j1 (3.5); // { dg-warning "" } double to int + int j2 (3.5f); // { dg-warning "" } float to int + + int k1 = 3.5; // { dg-warning "" } double to int + int k2 = 3.5f; // { dg-warning "" } float to int + + j1 = 3.5; // { dg-warning "" } double to int + j2 = 3.5f; // { dg-warning "" } float to int + + foo (3.5); // { dg-warning "" } double to int + foo (3.5f); // { dg-warning "" } float to int + + wibble (3.5); // { dg-warning "" } double to int + wibble (3.5f); // { dg-warning "" } float to int + wibble (1, 3.5); // { dg-warning "" } double to int + wibble (1, 3.5f); // { dg-warning "" } float to int + wibble (3.5, 1); // { dg-warning "" } double to int + wibble (3.5f, 1); // { dg-warning "" } float to int + + punk (); // { dg-warning "" } double to int + rock (1); // { dg-warning "" } double to int +} diff --git a/gcc/testsuite/g++.old-deja/g++.warn/impint2.C b/gcc/testsuite/g++.old-deja/g++.warn/impint2.C new file mode 100644 index 000000000..d5fbc5554 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.warn/impint2.C @@ -0,0 +1,69 @@ +// { dg-do assemble } +// { dg-options "-Wconversion" } + +// Copyright (C) 2000 Free Software Foundation, Inc. +// Contributed by Nathan Sidwell 6 Mar 2000 + +// initialization to 'int' from to 'double' We expect consistent warnings +// whenever a float is implicitly truncated to int, make sure references +// don't confuse us, as Gerald Pfeifer found out. + +struct X +{ + X (int const &); + X (int const &, int const &); +}; + +void foo (int const &); +void wibble (int const &); +void wibble (int const &, int const &); +void punk (int const & = 3.5f); // { dg-warning "" } in passing +void rock (); +void rock (int const &, int const & = 3.5f); // { dg-warning "" } in passing + +void fn () +{ + X x2(3.5f); // { dg-warning "" } float to int + X x4(1, 3.5f); // { dg-warning "" } float to int + X x6(3.5f, 1); // { dg-warning "" } float to int + + X y2 = 3.5f; // { dg-warning "" } float to int + + int j2 (3.5f); // { dg-warning "" } float to int + + int k2 = 3.5f; // { dg-warning "" } float to int + + j2 = 3.5f; // { dg-warning "" } float to int + + foo (3.5f); // { dg-warning "" } float to int + + wibble (3.5f); // { dg-warning "" } float to int + wibble (1, 3.5f); // { dg-warning "" } float to int + wibble (3.5f, 1); // { dg-warning "" } float to int + + punk (); // { dg-warning "" } float to int + rock (1); // { dg-warning "" } float to int +} + +// and make sure we really know when something's unsigned +void foo () +{ + X x2(-1); + X x4(1, -1); + X x6(-1, 1); + + X y2 = -1; + + int j2 (-1); + + int k2 = -1; + + j2 = -1; + + foo (-1); + + wibble (-1); + wibble (1, -1); + wibble (-1, 1); + +} diff --git a/gcc/testsuite/g++.old-deja/g++.warn/inline.C b/gcc/testsuite/g++.old-deja/g++.warn/inline.C new file mode 100644 index 000000000..51fbabdc2 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.warn/inline.C @@ -0,0 +1,69 @@ +// { dg-do assemble } +// { dg-options "-ansi -pedantic-errors -Winline -O1" } + +// Copyright (C) 2000 Free Software Foundation, Inc. +// Contributed by Nathan Sidwell 9 Mar 2000 + +// derived from a bug report by Benjamin Kosnik + +// __FUNCTION__ was erroneously causing us to issue a `cannot inline' +// diagnostic, even though we'd (a) inlined it, (b) been forced to issue an +// out of line body by taking it's address, (c) not used __FUNCTION__. + +inline void wibble () +{} + +inline void wobble () +{} // { dg-bogus "" } cannot inline + +void bar (void (*)()); + +void bar1 () +{ + wibble (); // can be inlined + void (*ptr) () = wobble; // force out of line issue + + bar (ptr); // make sure we make use of it +} + +struct B +{ + void mwibble () + {} + void mwobble () + {} // { dg-bogus "" } cannot inline + + static void swibble () + {} + static void swobble () + {} // { dg-bogus "" } cannot inline +}; + +void bar (void (B::*)()); + +void bar2 () +{ + B::swibble (); // can be inlined + void (*ptr) () = &B::swobble; // force out of line issue + + bar (ptr); // make sure we make use of it +} + +void bar3 (B *b) +{ + b->mwibble (); // can be inlined + void (B::*ptr) () = &B::mwobble; // force out of line issue + + bar (ptr); // make sure we make use of it +} + +struct C +{ + virtual void vwobble () + {} // { dg-bogus "" } cannot inline +}; + +void bar4 () +{ + C c; // force issue of C's vtable etc +} diff --git a/gcc/testsuite/g++.old-deja/g++.warn/iomanip.C b/gcc/testsuite/g++.old-deja/g++.warn/iomanip.C new file mode 100644 index 000000000..c437b26db --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.warn/iomanip.C @@ -0,0 +1,13 @@ +// { dg-do assemble } +// { dg-options "-O -Winline" } +// Bug: g++ wouldn't inline op<< because it was an explicit instantiation. +// Origin: Jason Merrill + +#include +#include + +void +f() +{ + std::cout << std::setw(3); +} diff --git a/gcc/testsuite/g++.old-deja/g++.warn/virt1.C b/gcc/testsuite/g++.old-deja/g++.warn/virt1.C new file mode 100644 index 000000000..4550dd5e0 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.warn/virt1.C @@ -0,0 +1,10 @@ +// { dg-do assemble } +// { dg-options "-Woverloaded-virtual" } + +struct A { + virtual void f(); // { dg-warning "" } hidden +}; + +struct B: public A { + void f(int); // { dg-warning "" } by this +}; -- cgit v1.2.3