backport: re PR fortran/51502 (Potentially wrong code generation due to wrong implict...
authorThomas Koenig <tkoenig@gcc.gnu.org>
Sun, 1 Jan 2012 16:27:45 +0000 (16:27 +0000)
committerThomas Koenig <tkoenig@gcc.gnu.org>
Sun, 1 Jan 2012 16:27:45 +0000 (16:27 +0000)
2012-01-01  Thomas König  <tkoenig@gcc.gnu.org>

Backport from trunk
PR fortran/51502
* lib/gcc-dg.exp (scan-module-absence):  New function.
* gfortran.dg/implicit_pure_2.f90:  New test.

From-SVN: r182771

gcc/testsuite/ChangeLog
gcc/testsuite/lib/gcc-dg.exp

index 143c0d1be7d87de8776109a83444e5d04d1048c6..f48bd72fe4652d32a1c13ba01440eb042c4e0087 100644 (file)
@@ -1,3 +1,9 @@
+2012-01-01  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR fortran/51502
+       * lib/gcc-dg.exp (scan-module-absence):  Really commit last
+       change.
+
 2012-01-01  Ira Rosen  <irar@il.ibm.com>
 
        PR tree-optimization/51704
index d0b679d7ad600010a31684650e5b62e80f189c41..026a8a96a6c411faa0354e93464ad7810a46cea9 100644 (file)
@@ -598,6 +598,24 @@ proc scan-module { args } {
     }
 }
 
+# Scan Fortran modules for absence of a given regexp.
+#
+# Argument 0 is the module name
+# Argument 1 is the regexp to match
+proc scan-module-absence { args } {
+    set modfilename [string tolower [lindex $args 0]].mod
+    set fd [open $modfilename r]
+    set text [read $fd]
+    close $fd
+
+    upvar 2 name testcase
+    if [regexp -- [lindex $args 1] $text] {
+      fail "$testcase scan-module [lindex $args 1]"
+    } else {
+      pass "$testcase scan-module [lindex $args 1]"
+    }
+}
+
 # Verify that the compiler output file exists, invoked via dg-final.
 proc output-exists { args } {
     # Process an optional target or xfail list.