aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@acm.org>2018-08-08 18:13:00 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2018-08-08 18:13:00 +0000
commitf10a91352f83232394646df5a67bdb8f4366a067 (patch)
treea4ec7ecbde7bfc84329e5a2bb1dc8dea689d7d31 /gcc/testsuite
parenta801991954f70fb9470502d305065719849c5660 (diff)
downloadgcc-f10a91352f83232394646df5a67bdb8f4366a067.zip
gcc-f10a91352f83232394646df5a67bdb8f4366a067.tar.gz
gcc-f10a91352f83232394646df5a67bdb8f4366a067.tar.bz2
[PATCH] line-map include-from representation
https://gcc.gnu.org/ml/gcc-patches/2018-08/msg00554.html Make linemap::included_from a location libcpp/ * include/line-map.h (struct line_map_ordinary): Replace included_from map index with included_at source_location. (ORDINARY_MAP_INCLUDER_FILE_INDEX): Delete. (LAST_SOURCE_LINE_LOCATION): Delete. (LAST_SOURCE_LINE, LAST_SOURCE_COLUMN): Delete. (linemap_included_from): New. (linemap_included_from_linemap): Declare. (MAIN_FILE_P): Adjust. * line-map.c (linemap_included_from_linemap): New. (lonemap_check_files_exited): Use linemap_included_at. (linemap_add): Adjust inclusion setting. (linemap_dump, linemap_dump_location): Adjust. * directives.c (do_linemarker): Use linemap_included_at. gcc/ * diagnostic.c (diagnostic_report_current_module): Use linemap_included_from & linemap_included_from_linemap. gcc/c-family/ * c-common.c (try_to_locate_new_include_inertion_point): Use linemap_included_from_linemap. * c-lex.c (fe_file_change): Use linemap_included_from. * c-ppoutput.c (pp_file_change): Likewise. gcc/fortran/ * cpp.c (cb_file_change): Use linemap_included_from. gcc/testsuite/ * c-c++-common/inc-from-1a.h, c-c++-common/inc-from-1b.h, c-c++-common/inc-from-1.c: New From-SVN: r263429
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/c-c++-common/inc-from-1.c5
-rw-r--r--gcc/testsuite/c-c++-common/inc-from-1a.h1
-rw-r--r--gcc/testsuite/c-c++-common/inc-from-1b.h1
4 files changed, 12 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 472e6a9..12f8425 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2018-08-08 Nathan Sidwell <nathan@acm.org>
+
+ * c-c++-common/inc-from-1a.h, c-c++-common/inc-from-1b.h,
+ c-c++-common/inc-from-1.c: New
+
2018-08-08 Andreas Krebbel <krebbel@linux.ibm.com>
PR target/85295
diff --git a/gcc/testsuite/c-c++-common/inc-from-1.c b/gcc/testsuite/c-c++-common/inc-from-1.c
new file mode 100644
index 0000000..7e95c2a
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/inc-from-1.c
@@ -0,0 +1,5 @@
+#include "inc-from-1b.h"
+
+/* { dg-error "" "" { target *-*-* } 1 } */
+
+/* { dg-regexp "In file included from \[^\n]*inc-from-1b.h:1,\n *from \[^\n]*inc-from-1.c:1:\n" } */
diff --git a/gcc/testsuite/c-c++-common/inc-from-1a.h b/gcc/testsuite/c-c++-common/inc-from-1a.h
new file mode 100644
index 0000000..684e812
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/inc-from-1a.h
@@ -0,0 +1 @@
+void bleah;
diff --git a/gcc/testsuite/c-c++-common/inc-from-1b.h b/gcc/testsuite/c-c++-common/inc-from-1b.h
new file mode 100644
index 0000000..40fae4a
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/inc-from-1b.h
@@ -0,0 +1 @@
+#include "inc-from-1a.h"