This part of the cleanup patch turns out to require more pieces to
function correctly. I must have got confused over which tree I was
testing. The very first map has a different pointer to the file name,
so doesn't match with a pointer compare. We were relying on that.
* c-common.c (try_to_locate_new_include_insertion_point): Revert change.
2020-05-20 Nathan Sidwell <nathan@acm.org>
+ * c-common.c (try_to_locate_new_include_insertion_point): Revert change.
+
* c-common.c (try_to_locate_new_include_insertion_point): Use
strcmp to compare filenames.
* c-lex.c (init_c_lex): Move declaration to initialization.
last_ord_map_after_include = NULL;
}
- if (0 == strcmp (ord_map->to_file, file)
- && ord_map->to_line)
+ if (ord_map->to_file == file)
{
if (!first_ord_map_in_file)
first_ord_map_in_file = ord_map;
--- /dev/null
+/* { dg-do preprocess }
+ { dg-options "-Dfrob=drob -Ddrob=BOB f.c -E -fdirectives-only -include cmd-1.h" }
+*/
+
+#define BOB bob()
+#define bob() dob
+
+frob
+
+/* Ensure fidelity of the preprocessed output. */
+/* { dg-final { scan-file cmd-1.o {# 0 "<command-line>"\n
+#define frob drob\n# 0 "<command-line>"\n#define drob BOB\n# 0 "<command-line>"\n# 1 "./h.h" 1\nb\n# 0 "<command-line>" 2\n# 1 "f.c"\n\n#define BOB bob()\n#define bob() dob\n} } }
+ */