diff options
author | no-author <no-author@gcc.gnu.org> | 2005-09-29 09:20:25 +0000 |
---|---|---|
committer | no-author <no-author@gcc.gnu.org> | 2005-09-29 09:20:25 +0000 |
commit | 361ae2cc7124ca382842dfcd8a7c5f762958169b (patch) | |
tree | 7f52722b04b40802ed23afe40fdfefb8440f641b | |
parent | f0d2d4ed294041efc93a8d4577c3f07a6cb9eb87 (diff) |
This commit was manufactured by cvs2svn to create branch
'gcc-4_0-rhl-branch'.
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_0-rhl-branch@104769 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/testsuite/g++.dg/lookup/error1.C | 9 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/template/array14.C | 10 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/warn/pr21983.C | 7 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/pr23941.c | 9 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pr23818.c | 33 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/i386/pr22576.c | 10 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/i386/pr22585.c | 12 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/interface_1.f90 | 40 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/save_1.f90 | 30 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.fortran-torture/execute/entry_11.f90 | 16 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.fortran-torture/execute/save_1.f90 | 29 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.fortran-torture/execute/save_2.f90 | 23 |
12 files changed, 228 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/lookup/error1.C b/gcc/testsuite/g++.dg/lookup/error1.C new file mode 100644 index 00000000000..2264b238403 --- /dev/null +++ b/gcc/testsuite/g++.dg/lookup/error1.C @@ -0,0 +1,9 @@ +// PR c++/17609 +// Origin: <papadopo@shfj.cea.fr> +// { dg-do compile } + +namespace N { int i; } +void foo() { i; } // { dg-error "not declared" } + +using namespace N; +void bar() { i; } diff --git a/gcc/testsuite/g++.dg/template/array14.C b/gcc/testsuite/g++.dg/template/array14.C new file mode 100644 index 00000000000..71a03f3bf30 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/array14.C @@ -0,0 +1,10 @@ +// PR c++/23993 + +const int data[2][4] = { + { 0, 1, 2, 3 } +}; + +template <typename T> +void t(int k) { + int candidate = data[1][k]; +} diff --git a/gcc/testsuite/g++.dg/warn/pr21983.C b/gcc/testsuite/g++.dg/warn/pr21983.C new file mode 100644 index 00000000000..3021c3ff500 --- /dev/null +++ b/gcc/testsuite/g++.dg/warn/pr21983.C @@ -0,0 +1,7 @@ +// PR c++/21983 +// { dg-do compile } + +struct B { virtual void foo () = 0; }; +struct D1 : public virtual B { virtual void foo () {} }; +struct D2 : public virtual B { virtual void foo () {} }; +struct D : public D1, public D2 { }; // { dg-warning "no unique final overrider" } diff --git a/gcc/testsuite/gcc.c-torture/execute/pr23941.c b/gcc/testsuite/gcc.c-torture/execute/pr23941.c new file mode 100644 index 00000000000..4dfd6451c38 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/pr23941.c @@ -0,0 +1,9 @@ +extern void abort (void); +double d = __FLT_MIN__ / 2.0; +int main() +{ + double x = __FLT_MIN__ / 2.0; + if (x != d) + abort (); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/pr23818.c b/gcc/testsuite/gcc.dg/pr23818.c new file mode 100644 index 00000000000..be0bb9a0101 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr23818.c @@ -0,0 +1,33 @@ +/* PR tree-optimization/23818 */ +/* { dg-do run } */ +/* { dg-options "-O2 -fno-tree-dominator-opts" } */ + +#include <stdarg.h> + +extern void abort (void); + +void +foo (int p[100], int k, ...) +{ + int j, *q; + va_list ap; + + va_start (ap, k); + q = va_arg (ap, int *); + for (j = 0; j < 100; j++) + q[j] = p[j] + 10; + va_end(ap); +} + +int +main (void) +{ + int buf[100], buf2[100], i; + for (i = 0; i < 100; i++) + buf[i] = i + 1; + foo (buf, 0, buf2); + for (i = 0; i < 100; i++) + if (buf2[i] != buf[i] + 10) + abort (); + return 0; +} diff --git a/gcc/testsuite/gcc.target/i386/pr22576.c b/gcc/testsuite/gcc.target/i386/pr22576.c new file mode 100644 index 00000000000..083fbf648c9 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr22576.c @@ -0,0 +1,10 @@ +/* PR target/22576 */ +/* Testcase reduced by Volker Reichelt */ +/* { dg-do compile } */ +/* { dg-options "-ffast-math" } */ + +int +foo (long double d) +{ + return d == 0; +} diff --git a/gcc/testsuite/gcc.target/i386/pr22585.c b/gcc/testsuite/gcc.target/i386/pr22585.c new file mode 100644 index 00000000000..9ba2da537fa --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr22585.c @@ -0,0 +1,12 @@ +/* PR target/22585 */ +/* Testcase reduced by Volker Reichelt */ +/* { dg-do compile } */ +/* { dg-options "-march=i386 -O -ffast-math" } */ +/* { dg-require-effective-target ilp32 } */ + +int +foo (long double d, int i) +{ + if (d == (long double) i) + return 1; +} diff --git a/gcc/testsuite/gfortran.dg/interface_1.f90 b/gcc/testsuite/gfortran.dg/interface_1.f90 new file mode 100644 index 00000000000..e2562e10417 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/interface_1.f90 @@ -0,0 +1,40 @@ +! { dg-do compile } +! This program would segfault without the patch for PR fortran/24005. +module y + ! + ! If private statement is removed, then we get a bunch of errors + ! + private f + ! + ! If we rename 'f' in module y to say 'g', then gfortran correctly + ! identifies ambiguous as being ambiguous. + ! + interface ambiguous + module procedure f + end interface + + contains + + real function f(a) + real a + f = a + end function + +end module y + +module z + + use y + + interface ambiguous + module procedure f ! { dg-error "in generic interface" "" } + end interface + + contains + + real function f(a) + real a + f = a + end function + +end module z diff --git a/gcc/testsuite/gfortran.dg/save_1.f90 b/gcc/testsuite/gfortran.dg/save_1.f90 new file mode 100644 index 00000000000..614986277a8 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/save_1.f90 @@ -0,0 +1,30 @@ +! { dg-options "-O2 -fno-automatic" } + subroutine foo (b) + logical b + integer i, j + character*24 s + save i + if (b) then + i = 26 + j = 131 + s = 'This is a test string' + else + if (i .ne. 26 .or. j .ne. 131) call abort + if (s .ne. 'This is a test string') call abort + end if + end subroutine foo + subroutine bar (s) + character*42 s + if (s .ne. '0123456789012345678901234567890123456') call abort + call foo (.false.) + end subroutine bar + subroutine baz + character*42 s + ! Just clobber stack a little bit. + s = '0123456789012345678901234567890123456' + call bar (s) + end subroutine baz + call foo (.true.) + call baz + call foo (.false.) + end diff --git a/gcc/testsuite/gfortran.fortran-torture/execute/entry_11.f90 b/gcc/testsuite/gfortran.fortran-torture/execute/entry_11.f90 new file mode 100644 index 00000000000..916891fdeb9 --- /dev/null +++ b/gcc/testsuite/gfortran.fortran-torture/execute/entry_11.f90 @@ -0,0 +1,16 @@ +! PR fortran/23663 + function i (n) + i = n + i = max (i, 6) + return + entry j (n) + j = n + j = max (j, 3) + end + + program entrytest + if (i (8).ne.8) call abort + if (i (4).ne.6) call abort + if (j (0).ne.3) call abort + if (j (7).ne.7) call abort + end diff --git a/gcc/testsuite/gfortran.fortran-torture/execute/save_1.f90 b/gcc/testsuite/gfortran.fortran-torture/execute/save_1.f90 new file mode 100644 index 00000000000..c838baa9874 --- /dev/null +++ b/gcc/testsuite/gfortran.fortran-torture/execute/save_1.f90 @@ -0,0 +1,29 @@ + subroutine foo (b) + logical b + integer i, j + character*24 s + save + if (b) then + i = 26 + j = 131 + s = 'This is a test string' + else + if (i .ne. 26 .or. j .ne. 131) call abort + if (s .ne. 'This is a test string') call abort + end if + end subroutine foo + subroutine bar (s) + character*42 s + if (s .ne. '0123456789012345678901234567890123456') call abort + call foo (.false.) + end subroutine bar + subroutine baz + character*42 s + ! Just clobber stack a little bit. + s = '0123456789012345678901234567890123456' + call bar (s) + end subroutine baz + call foo (.true.) + call baz + call foo (.false.) + end diff --git a/gcc/testsuite/gfortran.fortran-torture/execute/save_2.f90 b/gcc/testsuite/gfortran.fortran-torture/execute/save_2.f90 new file mode 100644 index 00000000000..c3775bbecc3 --- /dev/null +++ b/gcc/testsuite/gfortran.fortran-torture/execute/save_2.f90 @@ -0,0 +1,23 @@ +! PR fortran/18518 + program main + call foo + call bar + call foo + end program main + + subroutine foo + integer i,g,h + data i/0/ + equivalence (g,h) + save g + if (i == 0) then + i = 1 + h = 12345 + end if + if (h .ne. 12345) call abort + end subroutine foo + + subroutine bar + integer a(10) + a = 34 + end subroutine bar |