summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/debug
diff options
context:
space:
mode:
authorupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
committerupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
commit554fd8c5195424bdbcabf5de30fdc183aba391bd (patch)
tree976dc5ab7fddf506dadce60ae936f43f58787092 /gcc/testsuite/gfortran.dg/debug
downloadcbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.bz2
cbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.xz
obtained gcc-4.6.4.tar.bz2 from upstream website;upstream
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.
Diffstat (limited to 'gcc/testsuite/gfortran.dg/debug')
-rw-r--r--gcc/testsuite/gfortran.dg/debug/debug.exp41
-rw-r--r--gcc/testsuite/gfortran.dg/debug/pr35154-dwarf2.f38
-rw-r--r--gcc/testsuite/gfortran.dg/debug/pr35154-stabs.f35
-rw-r--r--gcc/testsuite/gfortran.dg/debug/pr37738.f31
-rw-r--r--gcc/testsuite/gfortran.dg/debug/pr43166.f14
-rw-r--r--gcc/testsuite/gfortran.dg/debug/pr46756.f29
-rw-r--r--gcc/testsuite/gfortran.dg/debug/trivial.f2
7 files changed, 190 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/debug/debug.exp b/gcc/testsuite/gfortran.dg/debug/debug.exp
new file mode 100644
index 000000000..0e0b4b91d
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/debug/debug.exp
@@ -0,0 +1,41 @@
+# Copyright (C) 2008 Free Software Foundation, Inc.
+
+# This file is part of GCC.
+#
+# GCC is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 3, or (at your option) any later
+# version.
+#
+# GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+# GCC testsuite that uses the `dg.exp' driver.
+
+# Load support procs.
+load_lib gfortran-dg.exp
+load_lib gfortran.exp
+
+# Debugging testsuite proc
+proc gfortran-debug-dg-test { prog do_what extra_tool_flags } {
+ return [gfortran-dg-test $prog $do_what $extra_tool_flags]
+}
+
+# Initialize `dg'.
+dg-init
+
+# Main loop.
+
+gfortran_init
+
+gfortran-dg-debug-runtest gfortran_target_compile trivial.f "" \
+ [lsort [glob -nocomplain $srcdir/$subdir/*.\[fS\]]]
+
+# All done.
+dg-finish
diff --git a/gcc/testsuite/gfortran.dg/debug/pr35154-dwarf2.f b/gcc/testsuite/gfortran.dg/debug/pr35154-dwarf2.f
new file mode 100644
index 000000000..40c13a4a1
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/debug/pr35154-dwarf2.f
@@ -0,0 +1,38 @@
+C Test program for common block debugging. G. Helffrich 11 July 2004.
+C { dg-do compile }
+C { dg-skip-if "DWARF-2 only" { "*-*-*" } { "*" } { "-gdwarf-2" } }
+C { dg-skip-if "DWARF-2 only" { "*-*-*" } { "-g1" } { "" } }
+C { dg-options "-dA -gno-strict-dwarf" }
+ common i,j
+ common /label/l,m
+ i = 1
+ j = 2
+ k = 3
+ l = 4
+ m = 5
+ call sub
+ end
+ subroutine sub
+ common /label/l,m
+ logical first
+ save n
+ data first /.true./
+ if (first) then
+ n = 0
+ first = .false.
+ endif
+ n = n + 1
+ l = l + 1
+ return
+ end
+
+C { dg-final { scan-assembler "DIE\[^\n\]*DW_TAG_common_block" } }
+C { dg-final { scan-assembler "(DW_AT_name: \"__BLNK__\"|\"__BLNK__\[^\n\]*\"\[^\n\]*DW_AT_name)" } }
+C { dg-final { scan-assembler "DIE\[^\n\]*DW_TAG_variable" } }
+C { dg-final { scan-assembler "\"i\[^\n\]*\"\[^\n\]*DW_AT_name" } }
+C { dg-final { scan-assembler "\"j\[^\n\]*\"\[^\n\]*DW_AT_name" } }
+C { dg-final { scan-assembler "DIE\[^\n\]*DW_TAG_common_block" } }
+C { dg-final { scan-assembler "(DW_AT_name: \"label\"|\"label\[^\n\]*\"\[^\n\]*DW_AT_name)" } }
+C { dg-final { scan-assembler "DIE\[^\n\]*DW_TAG_variable" } }
+C { dg-final { scan-assembler "\"l\[^\n\]*\"\[^\n\]*DW_AT_name" } }
+C { dg-final { scan-assembler "\"m\[^\n\]*\"\[^\n\]*DW_AT_name" } }
diff --git a/gcc/testsuite/gfortran.dg/debug/pr35154-stabs.f b/gcc/testsuite/gfortran.dg/debug/pr35154-stabs.f
new file mode 100644
index 000000000..a5976331b
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/debug/pr35154-stabs.f
@@ -0,0 +1,35 @@
+C Test program for common block debugging. G. Helffrich 11 July 2004.
+C { dg-do compile }
+C { dg-skip-if "No stabs" { mmix-*-* *-*-netware* alpha*-*-* hppa*64*-*-* ia64-*-* *-*-vxworks* } { "*" } { "" } }
+C { dg-skip-if "No stabs" {*-*-* } { "*" } { "-gstabs" } }
+ common i,j
+ common /label/l,m
+ i = 1
+ j = 2
+ k = 3
+ l = 4
+ m = 5
+ call sub
+ end
+ subroutine sub
+ common /label/l,m
+ logical first
+ save n
+ data first /.true./
+ if (first) then
+ n = 0
+ first = .false.
+ endif
+ n = n + 1
+ l = l + 1
+ return
+ end
+
+C { dg-final { scan-assembler ".stabs.*\"__BLNK__\",226" } }
+C { dg-final { scan-assembler ".stabs.*\"i:V.*\",.*,0" } }
+C { dg-final { scan-assembler ".stabs.*\"j:V.*\",.*,4" } }
+C { dg-final { scan-assembler ".stabs.*\"__BLNK__\",228" } }
+C { dg-final { scan-assembler ".stabs.*\"label_\",226" } }
+C { dg-final { scan-assembler ".stabs.*\"l:V.*\",.*,0" } }
+C { dg-final { scan-assembler ".stabs.*\"m:V.*\",.*,4" } }
+C { dg-final { scan-assembler ".stabs.*\"label_\",228" } }
diff --git a/gcc/testsuite/gfortran.dg/debug/pr37738.f b/gcc/testsuite/gfortran.dg/debug/pr37738.f
new file mode 100644
index 000000000..fddc44c7a
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/debug/pr37738.f
@@ -0,0 +1,31 @@
+C PR debug/37738
+C { dg-do compile }
+C { dg-skip-if "DWARF-2 only" { "*-*-*" } { "*" } { "-gdwarf-2" } }
+C { dg-skip-if "DWARF-2 only" { "*-*-*" } { "-g1" } { "" } }
+C { dg-options "-dA -gno-strict-dwarf" }
+
+ subroutine a
+ integer*4 a_i, c_i
+ common /block/a_i, c_i
+ a_i = 1
+ c_i = 4
+ end subroutine a
+ subroutine b
+ integer*4 b_i
+ common /block/b_i, d_i
+ b_i = 2
+ d_i = 5
+ end subroutine b
+ subroutine c
+ integer*4 a_i, c_i
+ common /block/a_i, c_i
+ if (a_i .ne. 2) call abort
+ if (c_i .ne. 5) call abort
+ end subroutine c
+ program abc
+ call a
+ call b
+ call c
+ end program abc
+
+C { dg-final { scan-assembler-times "DIE\[^\n\]*DW_TAG_common_block" 3 } }
diff --git a/gcc/testsuite/gfortran.dg/debug/pr43166.f b/gcc/testsuite/gfortran.dg/debug/pr43166.f
new file mode 100644
index 000000000..a3146150b
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/debug/pr43166.f
@@ -0,0 +1,14 @@
+C PR debug/43166
+C { dg-do compile }
+C { dg-options "-O" }
+ SUBROUTINE FOO ()
+ INTEGER V1
+ COMMON // V1
+ END
+ SUBROUTINE BAR ()
+ INTEGER V0,V1,V2,V3
+ COMMON // V1(4),V2(85,4),V3
+ DO V3=1,V1(1)
+ V0=V2(V3,1)
+ END DO
+ END
diff --git a/gcc/testsuite/gfortran.dg/debug/pr46756.f b/gcc/testsuite/gfortran.dg/debug/pr46756.f
new file mode 100644
index 000000000..fab06e394
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/debug/pr46756.f
@@ -0,0 +1,29 @@
+C PR debug/46756, reduced from ../20010519-1.f
+C { dg-do compile }
+C { dg-options "-O -fcompare-debug" }
+ LOGICAL QDISK,QDW,QCMPCT
+ LOGICAL LNOMA,LRAISE,LSCI,LBIG
+ ASSIGN 801 TO I800 ! { dg-warning "Deleted feature: ASSIGN" "Deleted feature: ASSIGN" }
+ GOTO 800
+ 801 CONTINUE
+ ASSIGN 761 TO I760 ! { dg-warning "Deleted feature: ASSIGN" "Deleted feature: ASSIGN" }
+ 761 CONTINUE
+ IF(LSCI) THEN
+ DO I=1,LENCM
+ ENDDO
+ ENDIF
+ DO WHILE((CVGMX.GT.TOLDIM).AND.(ITER.LT.ITMX))
+ IF(.NOT.QDW) THEN
+ ASSIGN 641 to I640 ! { dg-warning "Deleted feature: ASSIGN" "Deleted feature: ASSIGN" }
+ GOTO 640
+ 641 CONTINUE
+ ENDIF
+ ENDDO
+ GOTO 700
+ 640 CONTINUE
+ GOTO I640 ! { dg-warning "Deleted feature: Assigned" "Assigned GO TO" }
+ 700 CONTINUE
+ GOTO I760 ! { dg-warning "Deleted feature: Assigned" "Assigned GO TO" }
+ 800 CONTINUE
+ GOTO I800 ! { dg-warning "Deleted feature: Assigned" "Assigned GO TO" }
+ END
diff --git a/gcc/testsuite/gfortran.dg/debug/trivial.f b/gcc/testsuite/gfortran.dg/debug/trivial.f
new file mode 100644
index 000000000..4c3556725
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/debug/trivial.f
@@ -0,0 +1,2 @@
+ program trivial
+ end