dwarf2out.c (gen_compile_unit_die): Fallout to DW_LANG_Ada83 for Ada with strict...
authorOlivier Hainque <hainque@adacore.com>
Mon, 11 Jun 2018 09:42:54 +0000 (09:42 +0000)
committerOlivier Hainque <hainque@gcc.gnu.org>
Mon, 11 Jun 2018 09:42:54 +0000 (09:42 +0000)
2018-06-11  Olivier Hainque  <hainque@adacore.com>

        * dwarf2out.c (gen_compile_unit_die): Fallout to DW_LANG_Ada83
        for Ada with strict dwarf2.

testsuite/

        * gnat.dg/lang-dw2.adb: New test.
        * gnat.dg/lang-dw3.adb: New test.

From-SVN: r261432

gcc/ChangeLog
gcc/dwarf2out.c
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/langdw2.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/langdw3.adb [new file with mode: 0644]

index 367e91f4e9c3ee6a6a34e4a1cbaa20e7676447fc..2f745a5fbdfafb251db3f401dc2d126eac8f622e 100644 (file)
@@ -1,3 +1,8 @@
+2018-06-11  Olivier Hainque  <hainque@adacore.com>
+
+       * dwarf2out.c (gen_compile_unit_die): Fallout to DW_LANG_Ada83
+       for Ada with strict dwarf2.
+
 2018-06-08  Peter Bergner  <bergner@vnet.ibm.com>
 
        PR target/85755
index a6b20b4912dc76cafda826ee6ea535385968a02c..80323641d2cefa5524f0e041694dc11b2c45f196 100644 (file)
@@ -24460,6 +24460,9 @@ gen_compile_unit_die (const char *filename)
   /* Use a degraded Fortran setting in strict DWARF2 so is_fortran works.  */
   else if (strncmp (language_string, "GNU Fortran", 11) == 0)
     language = DW_LANG_Fortran90;
+  /* Likewise for Ada.  */
+  else if (strcmp (language_string, "GNU Ada") == 0)
+    language = DW_LANG_Ada83;
 
   add_AT_unsigned (die, DW_AT_language, language);
 
index b18759b389a1fe68f89d5913812766ec437ce0bb..0bdd3aa4cfab2d8f284bfc0f6d26cf7ecd8e81a4 100644 (file)
@@ -1,3 +1,8 @@
+2018-06-11  Olivier Hainque  <hainque@adacore.com>
+
+       * gnat.dg/lang-dw2.adb: New test.
+       * gnat.dg/lang-dw3.adb: New test.
+
 2018-06-11  Hristian Kirtchev  <kirtchev@adacore.com>
 
        * gnat.dg/assertion_policy1.adb, gnat.dg/assertion_policy1_pkg.adb,
diff --git a/gcc/testsuite/gnat.dg/langdw2.adb b/gcc/testsuite/gnat.dg/langdw2.adb
new file mode 100644 (file)
index 0000000..5e61ca2
--- /dev/null
@@ -0,0 +1,9 @@
+-- with strict dwarf2, we should produce DW_LANG_Ada83 (0x3) as AT_language
+
+-- { dg-do compile }
+-- { dg-skip-if "No dwarf-2 support" { hppa*-*-hpux* } }
+-- { dg-options "-cargs -gdwarf-2 -gstrict-dwarf -dA -margs" }
+-- { dg-final { scan-assembler "0x3\[^\n\r\]*AT_language" } }
+
+procedure Langdw2 is begin null;  end;
+   
diff --git a/gcc/testsuite/gnat.dg/langdw3.adb b/gcc/testsuite/gnat.dg/langdw3.adb
new file mode 100644 (file)
index 0000000..985df2b
--- /dev/null
@@ -0,0 +1,10 @@
+-- with dwarf3+ or !strict-dwarf, we should produce DW_LANG_Ada95 (0xd)
+-- as AT_language
+
+-- { dg-do compile }
+-- { dg-skip-if "No dwarf-2 support" { hppa*-*-hpux* } }
+-- { dg-options "-cargs -gdwarf-3 -dA -margs" }
+-- { dg-final { scan-assembler "0xd\[^\n\r\]*AT_language" } }
+
+procedure Langdw3 is begin null;  end;
+