aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@acm.org>2019-09-05 11:23:48 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2019-09-05 11:23:48 +0000
commit056f95ec951178a110b57e58a2ee434907de2e38 (patch)
treea8e6ad6be4a477e263294cb8c34feef8df71253e /gcc
parente7414688f16c4c9db2dacbc31da683887b4ba1bd (diff)
downloadgcc-056f95ec951178a110b57e58a2ee434907de2e38.zip
gcc-056f95ec951178a110b57e58a2ee434907de2e38.tar.gz
gcc-056f95ec951178a110b57e58a2ee434907de2e38.tar.bz2
[preprocessor/91639] #includes at EOF
https://gcc.gnu.org/ml/gcc-patches/2019-09/msg00280.html libcpp/ PR preprocessor/91639 * directives.c (do_include_common): Tell lexer we're a #include. * files.c (_cpp_stack_file): Lexer will have always incremented. * internal.h (struct cpp_context): Extend in_directive's semantics. * lex.c (_cpp_lex_direct): Increment line for final \n when lexing for an ISO #include. * line-map.c (linemap_line_start): Remember if we overflowed. gcc/testsuite/ PR preprocessor/91639 * c-c++-common/cpp/pr91639.c: New. * c-c++-common/cpp/pr91639-one.h: New. * c-c++-common/cpp/pr91639-two.h: New. From-SVN: r275402
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/ChangeLog7
-rw-r--r--gcc/testsuite/c-c++-common/cpp/pr91639-one.h2
-rw-r--r--gcc/testsuite/c-c++-common/cpp/pr91639-two.h1
-rw-r--r--gcc/testsuite/c-c++-common/cpp/pr91639.c9
4 files changed, 19 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index ce3a385..cdaa270 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+2019-09-05 Nathan Sidwell <nathan@acm.org>
+
+ PR preprocessor/91639
+ * c-c++-common/cpp/pr91639.c: New.
+ * c-c++-common/cpp/pr91639-one.h: New.
+ * c-c++-common/cpp/pr91639-two.h: New.
+
2019-09-05 Richard Sandiford <richard.sandiford@arm.com>
PR middle-end/91577
diff --git a/gcc/testsuite/c-c++-common/cpp/pr91639-one.h b/gcc/testsuite/c-c++-common/cpp/pr91639-one.h
new file mode 100644
index 0000000..141f6a7
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/cpp/pr91639-one.h
@@ -0,0 +1,2 @@
+one
+#include "pr91639-two.h"
diff --git a/gcc/testsuite/c-c++-common/cpp/pr91639-two.h b/gcc/testsuite/c-c++-common/cpp/pr91639-two.h
new file mode 100644
index 0000000..f719efd
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/cpp/pr91639-two.h
@@ -0,0 +1 @@
+two
diff --git a/gcc/testsuite/c-c++-common/cpp/pr91639.c b/gcc/testsuite/c-c++-common/cpp/pr91639.c
new file mode 100644
index 0000000..6da0b66
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/cpp/pr91639.c
@@ -0,0 +1,9 @@
+/* PR91639 Line markers for an end-of-file #include */
+/* { dg-do preprocess } */
+/* { dg-additional-options -Wno-pedantic } */
+/* { dg-additional-files {pr91639-one.h pr91639-two.h} } */
+
+#include "pr91639-one.h"
+main
+
+/* { dg-final { scan-file pr91639.i "# 1 \"\[^\n\"\]*pr91639-one.h\" 1\none\n# 1 \"\[^\n\"\]*pr91639-two.h\" 1\ntwo\n# 3 \"\[^\n\"\]*pr91639-one.h\" 2\n# 7 \"\[^\n\"\]*pr91639.c\" 2\nmain\n" } } */