Index: gcc/ChangeLog
authorGeoffrey Keating <geoffk@redhat.com>
Sat, 26 Jan 2002 02:38:57 +0000 (02:38 +0000)
committerGeoffrey Keating <geoffk@gcc.gnu.org>
Sat, 26 Jan 2002 02:38:57 +0000 (02:38 +0000)
* dbxout.c (dbxout_init): Use assemble_name rather than just
stripping off the first character.
(dbxout_source_file): Likewise.

Index: gcc/testsuite/ChangeLog

* gcc.dg/debug/debug.exp: New file.
        * gcc.dg/debug/trivial.c: New file.
        * gcc.dg/debug/20000503-1.c: Moved from gcc.dg/.
        * gcc.dg/debug/20010207-1.c: Moved from gcc.dg/.
        * gcc.dg/debug/20011223-1.c: Moved from gcc.dg/.
        * gcc.dg/debug/20020104-2.c: Moved from gcc.dg/.
        * gcc.dg/debug/debug-1.c: Moved from gcc.dg/.
        * gcc.dg/debug/debug-2.c: Moved from gcc.dg/.
        * gcc.dg/debug/debug-3.c: Moved from gcc.dg/.
        * gcc.dg/debug/debug-4.c: Moved from gcc.dg/.
        * gcc.dg/debug/debug-5.c: Moved from gcc.dg/.
        * gcc.dg/debug/debug-6.c: Moved from gcc.dg/.
        * gcc.dg/debug/dwarf2-1.c: Moved from gcc.dg/.
        * gcc.dg/debug/dwarf2-2.c: Moved from gcc.dg/.
        * gcc.dg/20000503-1.c: Removed.
        * gcc.dg/20010207-1.c: Removed.
        * gcc.dg/20011223-1.c: Removed.
        * gcc.dg/20020104-2.c: Removed.
        * gcc.dg/debug-1.c: Removed.
        * gcc.dg/debug-2.c: Removed.
        * gcc.dg/debug-3.c: Removed.
        * gcc.dg/debug-4.c: Removed.
        * gcc.dg/debug-5.c: Removed.
        * gcc.dg/debug-6.c: Removed.
        * gcc.dg/dwarf2-1.c: Removed.
        * gcc.dg/dwarf2-2.c: Removed.

From-SVN: r49238

29 files changed:
gcc/ChangeLog
gcc/dbxout.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/20000503-1.c [deleted file]
gcc/testsuite/gcc.dg/20010207-1.c [deleted file]
gcc/testsuite/gcc.dg/20011223-1.c [deleted file]
gcc/testsuite/gcc.dg/20020104-2.c [deleted file]
gcc/testsuite/gcc.dg/debug-1.c [deleted file]
gcc/testsuite/gcc.dg/debug-2.c [deleted file]
gcc/testsuite/gcc.dg/debug-3.c [deleted file]
gcc/testsuite/gcc.dg/debug-4.c [deleted file]
gcc/testsuite/gcc.dg/debug-5.c [deleted file]
gcc/testsuite/gcc.dg/debug-6.c [deleted file]
gcc/testsuite/gcc.dg/debug/20000503-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/debug/20010207-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/debug/20011223-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/debug/20020104-2.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/debug/debug-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/debug/debug-2.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/debug/debug-3.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/debug/debug-4.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/debug/debug-5.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/debug/debug-6.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/debug/debug.exp [new file with mode: 0644]
gcc/testsuite/gcc.dg/debug/dwarf2-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/debug/dwarf2-2.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/debug/trivial.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/dwarf2-1.c [deleted file]
gcc/testsuite/gcc.dg/dwarf2-2.c [deleted file]

index ac35801263cf0fd4f2afc39d7086221b83ed63bb..ec9b4ad76e3c9d9dba94d234e359b4e8c42e163d 100644 (file)
@@ -1,3 +1,9 @@
+2002-01-25  Geoffrey Keating  <geoffk@redhat.com>
+
+       * dbxout.c (dbxout_init): Use assemble_name rather than just
+       stripping off the first character.
+       (dbxout_source_file): Likewise.
+
 2002-01-25  DJ Delorie  <dj@redhat.com>
 
        * config/sparc/sparc.c (sparc_emit_set_symbolic_const64): Compare
index abcbee0ed979c6e6fec323c266af53635a059d23..f352745bddffb2759a91e67c48383b800a6be3d6 100644 (file)
@@ -439,7 +439,9 @@ dbxout_init (input_file_name)
 #else /* no DBX_OUTPUT_MAIN_SOURCE_DIRECTORY */
          fprintf (asmfile, "%s", ASM_STABS_OP);
          output_quoted_string (asmfile, cwd);
-         fprintf (asmfile, ",%d,0,0,%s\n", N_SO, &ltext_label_name[1]);
+         fprintf (asmfile, ",%d,0,0,", N_SO);
+         assemble_name (asmfile, ltext_label_name);
+         fputc ('\n', asmfile);
 #endif /* no DBX_OUTPUT_MAIN_SOURCE_DIRECTORY */
        }
     }
@@ -454,8 +456,9 @@ dbxout_init (input_file_name)
   /* Used to put `Ltext:' before the reference, but that loses on sun 4.  */
   fprintf (asmfile, "%s", ASM_STABS_OP);
   output_quoted_string (asmfile, input_file_name);
-  fprintf (asmfile, ",%d,0,0,%s\n", 
-          N_SO, &ltext_label_name[1]);
+  fprintf (asmfile, ",%d,0,0,", N_SO);
+  assemble_name (asmfile, ltext_label_name);
+  fputc ('\n', asmfile);
   text_section ();
   ASM_OUTPUT_INTERNAL_LABEL (asmfile, "Ltext", 0);
 #endif /* no DBX_OUTPUT_MAIN_SOURCE_FILENAME */
@@ -577,7 +580,9 @@ dbxout_source_file (file, filename)
                                   source_label_number);
       fprintf (file, "%s", ASM_STABS_OP);
       output_quoted_string (file, filename);
-      fprintf (file, ",%d,0,0,%s\n", N_SOL, &ltext_label_name[1]);
+      fprintf (asmfile, ",%d,0,0,", N_SOL);
+      assemble_name (asmfile, ltext_label_name);
+      fputc ('\n', asmfile);
       if (current_function_decl != NULL_TREE
          && DECL_SECTION_NAME (current_function_decl) != NULL_TREE)
        ; /* Don't change section amid function.  */
index a81e931503ba2b14550f1d44b08893e6c823851d..9b6fb5b3bbb31fe268feaab3d264f07f7a59a402 100644 (file)
@@ -1,3 +1,32 @@
+2002-01-25  Geoffrey Keating  <geoffk@redhat.com>
+
+       * gcc.dg/debug/debug.exp: New file.
+       * gcc.dg/debug/trivial.c: New file.
+       * gcc.dg/debug/20000503-1.c: Moved from gcc.dg/.
+       * gcc.dg/debug/20010207-1.c: Moved from gcc.dg/.
+       * gcc.dg/debug/20011223-1.c: Moved from gcc.dg/.
+       * gcc.dg/debug/20020104-2.c: Moved from gcc.dg/.
+       * gcc.dg/debug/debug-1.c: Moved from gcc.dg/.
+       * gcc.dg/debug/debug-2.c: Moved from gcc.dg/.
+       * gcc.dg/debug/debug-3.c: Moved from gcc.dg/.
+       * gcc.dg/debug/debug-4.c: Moved from gcc.dg/.
+       * gcc.dg/debug/debug-5.c: Moved from gcc.dg/.
+       * gcc.dg/debug/debug-6.c: Moved from gcc.dg/.
+       * gcc.dg/debug/dwarf2-1.c: Moved from gcc.dg/.
+       * gcc.dg/debug/dwarf2-2.c: Moved from gcc.dg/.
+       * gcc.dg/20000503-1.c: Removed.
+       * gcc.dg/20010207-1.c: Removed.
+       * gcc.dg/20011223-1.c: Removed.
+       * gcc.dg/20020104-2.c: Removed.
+       * gcc.dg/debug-1.c: Removed.
+       * gcc.dg/debug-2.c: Removed.
+       * gcc.dg/debug-3.c: Removed.
+       * gcc.dg/debug-4.c: Removed.
+       * gcc.dg/debug-5.c: Removed.
+       * gcc.dg/debug-6.c: Removed.
+       * gcc.dg/dwarf2-1.c: Removed.
+       * gcc.dg/dwarf2-2.c: Removed.
+
 2002-01-25  Jakub Jelinek  <jakub@redhat.com>
 
        * g++.old-deja/g++.other/eh5.C: New test.
diff --git a/gcc/testsuite/gcc.dg/20000503-1.c b/gcc/testsuite/gcc.dg/20000503-1.c
deleted file mode 100644 (file)
index a5900b8..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-/* { dg-do compile { target i?86-*-linux* i?86-*-sco3.2v5* i?86-*-sysv* } } */
-/* { dg-options "-O2 -gdwarf -g2" } */
-
-/* Distilled from GCC's stmt.c.  Caused abort in dwarf-1 code. */
-
-static void
-expand_nl_goto_receiver ()
-{
-{
-static struct elims {int from, to;} elim_regs[] = {{ 16, 7}, { 16, 6}, { 20, 7},{ 20, 6}};
-      int i;
-
-      for (i = 0; i < sizeof elim_regs / sizeof elim_regs[0]; i++)
-       if (elim_regs[i].from == 16 && elim_regs[i].to == 6)
-       break;
-      }
-}
diff --git a/gcc/testsuite/gcc.dg/20010207-1.c b/gcc/testsuite/gcc.dg/20010207-1.c
deleted file mode 100644 (file)
index b92615d..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-/* { dg-do compile { target i?86-*-[eflno]* } } */
-/* linux, (free|net|open)bsd and elf only */
-/* cygwin and mingw32, for example, don't support dwarf-2 */
-/* { dg-options "-O3 -gdwarf-2" } */
-
-extern inline int f1 (void) {return f2();}
-int f3 (void) {return f1();}
-int f1 (void) {return 0;}
diff --git a/gcc/testsuite/gcc.dg/20011223-1.c b/gcc/testsuite/gcc.dg/20011223-1.c
deleted file mode 100644 (file)
index 53f7f20..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-/* Origin: PR c/5163 from aj@suse.de.  */
-/* { dg-do compile } */
-/* { dg-options "-O3 -g" } */
-
-extern int bar (int);
-
-int
-foo (void)
-{
-  extern int bar (int);
-  return bar (5);
-}
diff --git a/gcc/testsuite/gcc.dg/20020104-2.c b/gcc/testsuite/gcc.dg/20020104-2.c
deleted file mode 100644 (file)
index 3bcafe0..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-/* This testcase used to fail because outlining_inline_function was called
-   too early, before rtl was generated.  */
-/* { dg-do compile } */
-/* { dg-options "-O3 -g" } */
-
-int foo (const int *x)
-{
-  char a[*x];
-  return 0;
-}
diff --git a/gcc/testsuite/gcc.dg/debug-1.c b/gcc/testsuite/gcc.dg/debug-1.c
deleted file mode 100644 (file)
index 1e53b14..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Verify that the scheduler does not discard the lexical block.  */
-/* { dg-do compile } */
-/* { dg-options "-O2 -g -dA" } */
-/* { dg-final { scan-assembler "xyzzy" } } */
-
-long foo(long p)
-{
-  {
-    long xyzzy = 0;
-    if (p)
-      xyzzy = 2;
-    return xyzzy;
-  }
-}
diff --git a/gcc/testsuite/gcc.dg/debug-2.c b/gcc/testsuite/gcc.dg/debug-2.c
deleted file mode 100644 (file)
index 4305059..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-/* Verify that the scheduler does not discard the lexical block.  */
-/* { dg-do compile } */
-/* { dg-options "-O2 -g -dA" } */
-/* { dg-final { scan-assembler "xyzzy" } } */
-
-long foo(long p)
-{
-  if (1)
-    {
-      long xyzzy = 0;
-      if (p)
-        xyzzy = 2;
-      return xyzzy;
-    }
-  else
-    {
-      int x = 0;
-      return x;
-    }
-}
diff --git a/gcc/testsuite/gcc.dg/debug-3.c b/gcc/testsuite/gcc.dg/debug-3.c
deleted file mode 100644 (file)
index b94c4eb..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/* This testcase failed, because scope containing baz was deleted
-   (spanned 0 basic blocks) and DWARF-2 couldn't find baz origin.  */
-/* { dg-do compile } */
-/* { dg-options "-O3 -g" } */
-
-struct A { char *a, *b, *c, *d; };
-
-static int
-bar (struct A *x)
-{
-  return x->c - x->b;
-}
-
-void fnptr (void (*fn) (void));
-
-void
-foo (void)
-{
-  struct A e;
-
-  {
-    void baz (void)
-      {
-       bar (&e);
-      }
-    fnptr (baz);
-  }
-  {
-    struct A *f;
-
-    f = &e;
-    if (f->c - f->a > f->d - f->a)
-      f->c = f->d;
-  }
-}
diff --git a/gcc/testsuite/gcc.dg/debug-4.c b/gcc/testsuite/gcc.dg/debug-4.c
deleted file mode 100644 (file)
index f3cf0c2..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/* This testcase failed, because scope containing baz was not emitted
-   (doesn't contain any instructions) and DWARF-2 couldn't find baz origin.  */
-/* { dg-do compile } */
-/* { dg-options "-O2 -g" } */
-
-struct A { char *a, *b, *c, *d; };
-
-static int
-bar (struct A *x)
-{
-  return x->c - x->b;
-}
-
-void
-foo (void)
-{
-  struct A e;
-
-  {
-    int baz (void)
-      {
-       return bar (&e);
-      }
-  }
-  if (e.c - e.a > e.d - e.a)
-    e.c = e.d;
-}
diff --git a/gcc/testsuite/gcc.dg/debug-5.c b/gcc/testsuite/gcc.dg/debug-5.c
deleted file mode 100644 (file)
index 4d1d229..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/* This testcase failed, because scope containing baz was deleted
-   (spanned 0 basic blocks) and DWARF-2 couldn't find baz origin.  */
-/* { dg-do compile } */
-/* { dg-options "-O3 -g" } */
-
-extern void abort (void);
-
-struct A { char *a, *b, *c, *d; };
-
-static int
-bar (struct A *x)
-{
-  return x->c - x->b;
-}
-
-static int
-bar2 (struct A *x)
-{
-  int a = x->c - x->b;
-  x->c += 26;
-  return a;
-}
-
-void fnptr (void (*fn) (void));
-
-void
-foo (void)
-{
-  struct A e;
-
-  if (bar2 (&e) < 0)
-    abort ();
-  {
-    void baz (void)
-      {
-       bar (&e);
-      }
-    fnptr (baz);
-  }
-  {
-    struct A *f;
-
-    f = &e;
-    if (f->c - f->a > f->d - f->a)
-      f->c = f->d;
-  }
-}
diff --git a/gcc/testsuite/gcc.dg/debug-6.c b/gcc/testsuite/gcc.dg/debug-6.c
deleted file mode 100644 (file)
index 1ed8679..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/* Verify that bb-reorder re-inserts nested scopes properly.  */
-/* { dg-do compile } */
-/* { dg-options "-O2 -g -dA" } */
-/* { dg-final { scan-assembler "xyzzy" } } */
-
-extern void abort (void);
-
-struct A { char *a, *b, *c, *d; };
-
-static int
-bar2 (struct A *x)
-{
-  int a = x->c - x->b;
-  x->c += 26;
-  return a;
-}
-   
-void fnptr (int *);
-
-void
-foo (void)
-{
-  struct A e;
-
-  if (bar2 (&e) < 0)
-    abort ();
-  {
-    int xyzzy;
-    fnptr (&xyzzy);
-  }
-  {
-    struct A *f;
-  
-    f = &e;
-    if (f->c - f->a > f->d - f->a)
-      f->c = f->d;
-  }
-}
diff --git a/gcc/testsuite/gcc.dg/debug/20000503-1.c b/gcc/testsuite/gcc.dg/debug/20000503-1.c
new file mode 100644 (file)
index 0000000..27d3c55
--- /dev/null
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+
+/* Distilled from GCC's stmt.c.  Caused abort in dwarf-1 code. */
+
+static void
+expand_nl_goto_receiver ()
+{
+{
+static struct elims {int from, to;} elim_regs[] = {{ 16, 7}, { 16, 6}, { 20, 7},{ 20, 6}};
+      int i;
+
+      for (i = 0; i < sizeof elim_regs / sizeof elim_regs[0]; i++)
+       if (elim_regs[i].from == 16 && elim_regs[i].to == 6)
+       break;
+      }
+}
diff --git a/gcc/testsuite/gcc.dg/debug/20010207-1.c b/gcc/testsuite/gcc.dg/debug/20010207-1.c
new file mode 100644 (file)
index 0000000..513d7a4
--- /dev/null
@@ -0,0 +1,4 @@
+/* { dg-do compile } */
+extern inline int f1 (void) {return f2();}
+int f3 (void) {return f1();}
+int f1 (void) {return 0;}
diff --git a/gcc/testsuite/gcc.dg/debug/20011223-1.c b/gcc/testsuite/gcc.dg/debug/20011223-1.c
new file mode 100644 (file)
index 0000000..f8d70ab
--- /dev/null
@@ -0,0 +1,11 @@
+/* Origin: PR c/5163 from aj@suse.de.  */
+/* { dg-do compile } */
+
+extern int bar (int);
+
+int
+foo (void)
+{
+  extern int bar (int);
+  return bar (5);
+}
diff --git a/gcc/testsuite/gcc.dg/debug/20020104-2.c b/gcc/testsuite/gcc.dg/debug/20020104-2.c
new file mode 100644 (file)
index 0000000..854d174
--- /dev/null
@@ -0,0 +1,9 @@
+/* This testcase used to fail because outlining_inline_function was called
+   too early, before rtl was generated.  */
+/* { dg-do compile } */
+
+int foo (const int *x)
+{
+  char a[*x];
+  return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/debug/debug-1.c b/gcc/testsuite/gcc.dg/debug/debug-1.c
new file mode 100644 (file)
index 0000000..b413eb7
--- /dev/null
@@ -0,0 +1,14 @@
+/* Verify that the scheduler does not discard the lexical block.  */
+/* { dg-do compile } */
+/* { dg-options "-dA" } */
+/* { dg-final { scan-assembler "xyzzy" } } */
+
+long foo(long p)
+{
+  {
+    long xyzzy = 0;
+    if (p)
+      xyzzy = 2;
+    return xyzzy;
+  }
+}
diff --git a/gcc/testsuite/gcc.dg/debug/debug-2.c b/gcc/testsuite/gcc.dg/debug/debug-2.c
new file mode 100644 (file)
index 0000000..e11b7b0
--- /dev/null
@@ -0,0 +1,20 @@
+/* Verify that the scheduler does not discard the lexical block.  */
+/* { dg-do compile } */
+/* { dg-options "-dA" } */
+/* { dg-final { scan-assembler "xyzzy" } } */
+
+long foo(long p)
+{
+  if (1)
+    {
+      long xyzzy = 0;
+      if (p)
+        xyzzy = 2;
+      return xyzzy;
+    }
+  else
+    {
+      int x = 0;
+      return x;
+    }
+}
diff --git a/gcc/testsuite/gcc.dg/debug/debug-3.c b/gcc/testsuite/gcc.dg/debug/debug-3.c
new file mode 100644 (file)
index 0000000..bb819f4
--- /dev/null
@@ -0,0 +1,34 @@
+/* This testcase failed, because scope containing baz was deleted
+   (spanned 0 basic blocks) and DWARF-2 couldn't find baz origin.  */
+/* { dg-do compile } */
+
+struct A { char *a, *b, *c, *d; };
+
+static int
+bar (struct A *x)
+{
+  return x->c - x->b;
+}
+
+void fnptr (void (*fn) (void));
+
+void
+foo (void)
+{
+  struct A e;
+
+  {
+    void baz (void)
+      {
+       bar (&e);
+      }
+    fnptr (baz);
+  }
+  {
+    struct A *f;
+
+    f = &e;
+    if (f->c - f->a > f->d - f->a)
+      f->c = f->d;
+  }
+}
diff --git a/gcc/testsuite/gcc.dg/debug/debug-4.c b/gcc/testsuite/gcc.dg/debug/debug-4.c
new file mode 100644 (file)
index 0000000..62e824a
--- /dev/null
@@ -0,0 +1,26 @@
+/* This testcase failed, because scope containing baz was not emitted
+   (doesn't contain any instructions) and DWARF-2 couldn't find baz origin.  */
+/* { dg-do compile } */
+
+struct A { char *a, *b, *c, *d; };
+
+static int
+bar (struct A *x)
+{
+  return x->c - x->b;
+}
+
+void
+foo (void)
+{
+  struct A e;
+
+  {
+    int baz (void)
+      {
+       return bar (&e);
+      }
+  }
+  if (e.c - e.a > e.d - e.a)
+    e.c = e.d;
+}
diff --git a/gcc/testsuite/gcc.dg/debug/debug-5.c b/gcc/testsuite/gcc.dg/debug/debug-5.c
new file mode 100644 (file)
index 0000000..8f26fc4
--- /dev/null
@@ -0,0 +1,46 @@
+/* This testcase failed, because scope containing baz was deleted
+   (spanned 0 basic blocks) and DWARF-2 couldn't find baz origin.  */
+/* { dg-do compile } */
+
+extern void abort (void);
+
+struct A { char *a, *b, *c, *d; };
+
+static int
+bar (struct A *x)
+{
+  return x->c - x->b;
+}
+
+static int
+bar2 (struct A *x)
+{
+  int a = x->c - x->b;
+  x->c += 26;
+  return a;
+}
+
+void fnptr (void (*fn) (void));
+
+void
+foo (void)
+{
+  struct A e;
+
+  if (bar2 (&e) < 0)
+    abort ();
+  {
+    void baz (void)
+      {
+       bar (&e);
+      }
+    fnptr (baz);
+  }
+  {
+    struct A *f;
+
+    f = &e;
+    if (f->c - f->a > f->d - f->a)
+      f->c = f->d;
+  }
+}
diff --git a/gcc/testsuite/gcc.dg/debug/debug-6.c b/gcc/testsuite/gcc.dg/debug/debug-6.c
new file mode 100644 (file)
index 0000000..4fe680d
--- /dev/null
@@ -0,0 +1,38 @@
+/* Verify that bb-reorder re-inserts nested scopes properly.  */
+/* { dg-do compile } */
+/* { dg-options "-dA" } */
+/* { dg-final { scan-assembler "xyzzy" } } */
+
+extern void abort (void);
+
+struct A { char *a, *b, *c, *d; };
+
+static int
+bar2 (struct A *x)
+{
+  int a = x->c - x->b;
+  x->c += 26;
+  return a;
+}
+   
+void fnptr (int *);
+
+void
+foo (void)
+{
+  struct A e;
+
+  if (bar2 (&e) < 0)
+    abort ();
+  {
+    int xyzzy;
+    fnptr (&xyzzy);
+  }
+  {
+    struct A *f;
+  
+    f = &e;
+    if (f->c - f->a > f->d - f->a)
+      f->c = f->d;
+  }
+}
diff --git a/gcc/testsuite/gcc.dg/debug/debug.exp b/gcc/testsuite/gcc.dg/debug/debug.exp
new file mode 100644 (file)
index 0000000..310ce13
--- /dev/null
@@ -0,0 +1,78 @@
+#   Copyright (C) 2002 Free Software Foundation, Inc.
+
+# This program 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 2 of the License, or
+# (at your option) any later version.
+# 
+# This program 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 this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
+
+# GCC testsuite that uses the `dg.exp' driver.
+
+# Load support procs.
+load_lib gcc-dg.exp
+
+# This is the list of debugging options we'll try.  Some of them won't
+# be supported, that's OK; they will be quickly eliminated.
+# It's probably not a good idea to add more optimisation options.
+
+if ![info exists DEBUG_TORTURE_OPTIONS] {
+    set DEBUG_TORTURE_OPTIONS ""
+    foreach type {-gdwarf-2 -gstabs -gstabs+ -gxcoff -gxcoff+ -gcoff} {
+       set comp_output [gcc_target_compile \
+               "$srcdir/$subdir/trivial.c" "trivial.S" assembly \
+               "additional_flags=$type"]
+       if { ! [string match "*: unknown or unsupported -g option*" \
+               $comp_output] } {
+           foreach level {1 "" 3} {
+               lappend DEBUG_TORTURE_OPTIONS [list "${type}${level}"]
+               foreach opt { -O -O3 } {
+                   lappend DEBUG_TORTURE_OPTIONS \
+                           [list "${type}${level}" "$opt" ]
+               }
+           }
+       }
+    }
+}
+
+verbose -log "Using options $DEBUG_TORTURE_OPTIONS"
+
+# Initialize `dg'.
+dg-init
+
+# Main loop.
+
+foreach test [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] {
+    global runtests
+
+    # If we're only testing specific files and this isn't one of 
+    # them, skip it.
+    if ![runtest_file_p $runtests $test] {
+       continue
+    }
+
+    set nshort [file tail [file dirname $test]]/[file tail $test]
+
+    foreach flags $DEBUG_TORTURE_OPTIONS {
+       set doit 1
+       if { [string match {*/debug-[126].c} "$nshort"] \
+               && [string match "*1" [lindex "$flags" 0] ] } { 
+           set doit 0
+       }
+       
+       if { $doit } {
+           verbose -log "Testing $nshort, $flags" 1
+           dg-test $test $flags ""
+       }
+    }
+}
+
+# All done.
+dg-finish
diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2-1.c b/gcc/testsuite/gcc.dg/debug/dwarf2-1.c
new file mode 100644 (file)
index 0000000..3eb4f95
--- /dev/null
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+
+/* Copyright (C) 2000  Free Software Foundation  */
+/* Contributed by Alexandre Oliva <aoliva@cygnus.com> */
+
+static int foo () {}
+
+int bar () {
+  int foo ();
+  int foo ();
+}
diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2-2.c b/gcc/testsuite/gcc.dg/debug/dwarf2-2.c
new file mode 100644 (file)
index 0000000..0c3cee1
--- /dev/null
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+
+/* Copyright (C) 2000  Free Software Foundation  */
+/* Contributed by Alexandre Oliva <aoliva@redhat.com> */
+
+inline double fx (double x)
+{
+  return 3 * x;
+}
+
+main ()
+{
+  double a = 0, fx (double), foo ();
+  fx (a);
+  if (a != 3)
+    foo ();
+}
diff --git a/gcc/testsuite/gcc.dg/debug/trivial.c b/gcc/testsuite/gcc.dg/debug/trivial.c
new file mode 100644 (file)
index 0000000..5b125ec
--- /dev/null
@@ -0,0 +1,6 @@
+/* { dg-do run } */
+
+int main(void)
+{
+  return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/dwarf2-1.c b/gcc/testsuite/gcc.dg/dwarf2-1.c
deleted file mode 100644 (file)
index 9135cf7..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-O3 -g" } */
-
-/* Copyright (C) 2000  Free Software Foundation  */
-/* Contributed by Alexandre Oliva <aoliva@cygnus.com> */
-
-static int foo () {}
-
-int bar () {
-  int foo ();
-  int foo ();
-}
diff --git a/gcc/testsuite/gcc.dg/dwarf2-2.c b/gcc/testsuite/gcc.dg/dwarf2-2.c
deleted file mode 100644 (file)
index 82e5d8d..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-O -g" } */
-
-/* Copyright (C) 2000  Free Software Foundation  */
-/* Contributed by Alexandre Oliva <aoliva@redhat.com> */
-
-inline double fx (double x)
-{
-  return 3 * x;
-}
-
-main ()
-{
-  double a = 0, fx (double), foo ();
-  fx (a);
-  if (a != 3)
-    foo ();
-}