summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/debug
diff options
context:
space:
mode:
authorgeorge <george@138bc75d-0d04-0410-961f-82ee72b054a4>2008-04-26 09:46:01 +0000
committergeorge <george@138bc75d-0d04-0410-961f-82ee72b054a4>2008-04-26 09:46:01 +0000
commit2f1b79be769a7657417ac888381a2eaba23a52d7 (patch)
tree41a41127f1938338b6b87dd1bde0414e40bfc07f /gcc/testsuite/gfortran.dg/debug
parent346c9aafb198d89fc3480cb4e9b9003443697ceb (diff)
downloadgcc-2f1b79be769a7657417ac888381a2eaba23a52d7.tar.gz
2008-04-26 George Helffrich <george@gcc.gnu.org>
PR fortran/35892 PR fortran/35154 * fortran/trans-common.c (create_common): Add decl to function chain (if inside one) to preserve identifier scope in debug output. * testsuite/gfortran.dg/debug/pr35154-stabs.f: New test case for .stabs functionality. * testsuite/gfortran.dg/debug/pr35154-dwarf2.f: New test case for DWARF functionality. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@134696 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gfortran.dg/debug')
-rw-r--r--gcc/testsuite/gfortran.dg/debug/pr35154-dwarf2.f37
-rw-r--r--gcc/testsuite/gfortran.dg/debug/pr35154-stabs.f35
2 files changed, 72 insertions, 0 deletions
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 00000000000..0203d134a62
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/debug/pr35154-dwarf2.f
@@ -0,0 +1,37 @@
+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-options "-dA" }
+ 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.*DW_TAG_common_block)" } }
+C { dg-final { scan-assembler "DW_AT_name: \"__BLNK__\"" } }
+C { dg-final { scan-assembler "(DIE.*DW_TAG_member)" } }
+C { dg-final { scan-assembler "\"i.*\".*DW_AT_name" } }
+C { dg-final { scan-assembler "\"j.*\".*DW_AT_name" } }
+C { dg-final { scan-assembler "(DIE.*DW_TAG_common_block)" } }
+C { dg-final { scan-assembler "DW_AT_name: \"label\"" } }
+C { dg-final { scan-assembler "(DIE.*DW_TAG_member)" } }
+C { dg-final { scan-assembler "\"l.*\".*DW_AT_name" } }
+C { dg-final { scan-assembler "\"m.*\".*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 00000000000..7294771bd3e
--- /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-*-* *-*-sysv5* *-*-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" } }