From a50c005fea650125aa5bd574b64dd0aae9b206a4 Mon Sep 17 00:00:00 2001 From: Bud Davis Date: Fri, 26 Nov 2010 16:11:14 +0000 Subject: [PATCH] arith_divide_no_check.f [...]: new tests. 2010-11-22 Bud Davis * arith_divide_no_check.f ,arith_divide.f,old_style_init.f90: new tests. From-SVN: r167182 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gfortran.dg/arith_divide.f | 15 +++++++++++++++ .../gfortran.dg/arith_divide_no_check.f | 17 +++++++++++++++++ gcc/testsuite/gfortran.dg/old_style_init.f90 | 15 +++++++++++++++ 4 files changed, 52 insertions(+) create mode 100644 gcc/testsuite/gfortran.dg/arith_divide.f create mode 100644 gcc/testsuite/gfortran.dg/arith_divide_no_check.f create mode 100644 gcc/testsuite/gfortran.dg/old_style_init.f90 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index fbbee38fe1d..57a7b42cb39 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2010-11-22 Bud Davis + + * arith_divide_no_check.f + ,arith_divide.f,old_style_init.f90: new tests. + 2010-11-26 H.J. Lu PR tree-optimization/46665 diff --git a/gcc/testsuite/gfortran.dg/arith_divide.f b/gcc/testsuite/gfortran.dg/arith_divide.f new file mode 100644 index 00000000000..5140e2c7708 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/arith_divide.f @@ -0,0 +1,15 @@ +! { dg-do compile } +! This test executes all code paths in gfc_arith_divide +! when executed along with it's companion test +! arith_divide_no_check.f + implicit none + integer i,j + real a,b + complex c,d + i = 10/40 + j = 10/0! { dg-error "Division by zero at" } + a = 10.0/40.0 + b = 10.0/0.0! { dg-error "Division by zero at" } + c = (1.0,1.0)/(10.0,40.0) ! Not division by zero + d = (1.0,10.)/(0.0,0.0)! { dg-error "Division by zero at" } + end diff --git a/gcc/testsuite/gfortran.dg/arith_divide_no_check.f b/gcc/testsuite/gfortran.dg/arith_divide_no_check.f new file mode 100644 index 00000000000..82ef1c35990 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/arith_divide_no_check.f @@ -0,0 +1,17 @@ +! { dg-do compile } +! { dg-options "-fno-range-check" } +! This test executes all code paths in gfc_arith_divide +! when executed along with it's companion test +! arith_divide.f + + implicit none + integer i,j + real a,b + complex c,d + i = 10/40 + j = 10/0! { dg-error "Division by zero at" } + a = 10.0/40.0 + b = 10.0/0.0 + c = (1.0,1.0)/(10.0,40.0) + d = (1.0,10.)/(0.0,0.0) + end diff --git a/gcc/testsuite/gfortran.dg/old_style_init.f90 b/gcc/testsuite/gfortran.dg/old_style_init.f90 new file mode 100644 index 00000000000..5319917f7a8 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/old_style_init.f90 @@ -0,0 +1,15 @@ +!{ dg-do compile } +! this routine tests all the execution paths +! through the routine known as match_old_style_init() +! it does not make sense in any other context !! + subroutine sub1(Z) !{ dg-error "DATA attribute conflicts" } + integer Z/10/!{ dg-error "DATA"} + end + pure function pi(k) + integer ,intent(in) :: k + integer i / 10 / !{ dg-error "Initialization at " } + pi=3.0 + end function pi + subroutine sub2 + integer I / /!{ dg-error "Syntax error in DATA" } + end -- 2.30.2