[Testsuite patch]: new fortran tests
Uttam Pawar
uttamp@us.ibm.com
Fri Nov 11 15:23:00 GMT 2005
Hi,
Resubmitting few fortran (gfortran.dg) tests (for cpu_time intrinsic
function and 'pure' construct) along with 2 new tests for DO construct.
Any feedback is appreciated.
Thanks,
Uttam
2005-10-24 Uttam Pawar <uttamp@us.ibm.com>
* gfortran.dg/cpu_time_1.f90: New test.
* gfortran.dg/pure_1.f90: New test.
* gfortran.dg/real_do_2.f90: New test.
* gfortran.dg/real_do_3.f90: New test.
diff -urN gcc.testsuite/gfortran.dg/cpu_time_1.f90
gcc_mine.testsuite/gfortran.dg/cpu_time_1.f90
--- gcc.testsuite/gfortran.dg/cpu_time_1.f90 1969-12-31
16:00:00.000000000 -0800
+++ gcc_mine.testsuite/gfortran.dg/cpu_time_1.f90 2005-10-26
09:35:59.000000000 -0700
@@ -0,0 +1,13 @@
+! { dg-do compile }
+! Check the constraints on intrinsic 'CPU_TIME'.
+
+program test_cpu_time
+ character c_T1
+ character*2 s_T1
+ integer i_T1
+ complex cx_T1
+ call cpu_time(c_T1) ! { dg-error "must be REAL" "" }
+ call cpu_time(s_T1) ! { dg-error "must be REAL" "" }
+ call cpu_time(i_T1) ! { dg-error "must be REAL" "" }
+ call cpu_time(cx_T1) ! { dg-error "must be REAL" "" }
+end program test_cpu_time
diff -urN gcc.testsuite/gfortran.dg/pure_1.f90
gcc_mine.testsuite/gfortran.dg/pure_1.f90
--- gcc.testsuite/gfortran.dg/pure_1.f90 1969-12-31
16:00:00.000000000 -0800
+++ gcc_mine.testsuite/gfortran.dg/pure_1.f90 2005-10-26
09:32:46.000000000 -0700
@@ -0,0 +1,10 @@
+! { dg-do compile }
+! Check the constraints on 'pure' procedure
+pure function pure_func ()
+ character str1*8
+ pause ! { dg-error "not allowed in PURE
procedure" "" }
+ stop ! { dg-error "not allowed in PURE
procedure" "" }
+ open(2, FILE='new.src') ! { dg-error "not allowed in PURE
procedure" "" }
+ close(2) ! { dg-error "not allowed in PURE
procedure" "" }
+ print *, "test msg" ! { dg-error "not allowed within PURE
procedure" "" }
+end function pure_func
diff -urN gcc.testsuite/gfortran.dg/real_do_2.f90
gcc_mine.testsuite/gfortran.dg/real_do_2.f90
--- gcc.testsuite/gfortran.dg/real_do_2.f90 1969-12-31
16:00:00.000000000 -0800
+++ gcc_mine.testsuite/gfortran.dg/real_do_2.f90 2005-11-10
21:12:44.000000000 -0800
@@ -0,0 +1,17 @@
+! { dg-do compile }
+! { dg-options "-std=f95" }
+! Test REAL type iterators in DO loops
+program real_do_2
+ real x
+ double precision y
+ integer n
+
+ n = 0
+ do x = 1.0, 0.1 ! { dg-error "Obsolete: REAL DO loop iterator" "" }
+ n = n + 1
+ end do
+ n = 0
+ do y = 1.0, 0.1 ! { dg-error "Obsolete: REAL DO loop iterator" ""}
+ n = n + 1
+ end do
+end program
diff -urN gcc.testsuite/gfortran.dg/real_do_3.f90
gcc_mine.testsuite/gfortran.dg/real_do_3.f90
--- gcc.testsuite/gfortran.dg/real_do_3.f90 1969-12-31
16:00:00.000000000 -0800
+++ gcc_mine.testsuite/gfortran.dg/real_do_3.f90 2005-11-10
21:10:43.000000000 -0800
@@ -0,0 +1,11 @@
+! { dg-do run }
+! Test REAL type iterators in DO loops
+program real_do_2
+ double precision y
+ integer n
+
+ n = 0
+ do y = 1.0, 0.1 ! { dg-warning "Obsolete: REAL DO loop iterator" ""}
+ n = n + 1
+ end do
+end program
More information about the Gcc-patches
mailing list