@@ -33,6 +33,7 @@ along with GCC; see the file COPYING3. If not see
#include "trans-types.h"
#include "trans-const.h"
#include "options.h"
+#include "file-prefix-map.h" /* remap_macro_filename() */
/* Members of the ioparm structure. */
@@ -1026,7 +1027,7 @@ set_error_locus (stmtblock_t * block, tree var, locus
* where)
TREE_TYPE (p->field), locus_file,
p->field, NULL_TREE);
f = where->lb->file;
- str = gfc_build_cstring_const (f->filename);
+ str = gfc_build_cstring_const (remap_macro_filename(f->filename));
str = gfc_build_addr_expr (pchar_type_node, str);
gfc_add_modify (block, locus_file, str);
b/gcc/testsuite/gfortran.dg/pr96069.f90
new file mode 100644
@@ -0,0 +1,11 @@
+! { dg-do compile }
+! { dg-options "-ffile-prefix-map==MACRO-PREFIX" }
+
+subroutine f(name)
+ implicit none
+ character*(*) name
+ print *,name
+ return
+end subroutine f
+
+! { dg-final { scan-assembler ".string\t\"MACRO-PREFIX" } }