@@ -1432,7 +1432,12 @@ get_substring_ranges_for_loc (cpp_reader *pfile,
for start vs finish due to line-length jumps. */
if (start_ord_map != final_ord_map
&& start_ord_map->to_file != final_ord_map->to_file)
- return "start and finish are spelled in different ordinary maps";
+ return "start and finish are spelled in different ordinary maps";
+ /* The file from linemap_resolve_location ought to match that from
+ expand_location_to_spelling_point. */
+ if (start_ord_map->to_file != start.file)
+ return "mismatching file after resolving linemap";
+
location_t start_loc
= linemap_position_for_line_and_column (line_table, final_ord_map,
start.line, start.column);
new file mode 100644
@@ -0,0 +1,23 @@
+/* { dg-options "-Wformat -fdiagnostics-show-caret" } */
+
+#include "Wformat-pr88257.h"
+
+void test (const char *msg)
+{
+ __builtin_printf ("size: %" PRIu32 "\n", msg); /* { dg-warning "expects argument of type" } */
+ /* { dg-begin-multiline-output "" }
+ __builtin_printf ("size: %" PRIu32 "\n", msg);
+ ^~~~~~~~~ ~~~
+ |
+ const char *
+ { dg-end-multiline-output "" { target c } } */
+ /* { dg-begin-multiline-output "" }
+ # define PRIu32 "u"
+ { dg-end-multiline-output "" { target c } } */
+ /* { dg-begin-multiline-output "" }
+ __builtin_printf ("size: %" PRIu32 "\n", msg);
+ ^~~~~~~~~~~~~~~~~~~~~ ~~~
+ |
+ const char*
+ { dg-end-multiline-output "" { target c++ } } */
+}
new file mode 100644
@@ -0,0 +1,26 @@
+#pragma GCC system_header
+
+/* Whitespace is significant here, due to line numbering.
+ See the comment below.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ End of significant whitespace */
+
+#include "empty.h"
+/* The preceding include ensures a line map starts here, with a line
+ number greater than that of the usage site, to try to trigger
+ an assertion failure. */
+
+# define PRIu32 "u"