aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2024-06-04 21:15:02 -0400
committerJason Merrill <jason@redhat.com>2024-11-18 09:18:17 +0100
commit7b8b96a327f2201531c0a2b32db490532db4aa39 (patch)
tree230f7a30b0642864aa8b2c2fd764b50b50327447 /gcc
parent0dc389f21bfd4ee49d57bcfaa1d1936456c55e48 (diff)
downloadgcc-7b8b96a327f2201531c0a2b32db490532db4aa39.zip
gcc-7b8b96a327f2201531c0a2b32db490532db4aa39.tar.gz
gcc-7b8b96a327f2201531c0a2b32db490532db4aa39.tar.bz2
libcpp: add .c++-header-unit target
The dependency output for header unit modules is based on the absolute pathname of the header file, but that's not something that a makefile can portably refer to. This patch adds a .c++-header-unit target based on the header name relative to an element of the include path. libcpp/ChangeLog: * internal.h (_cpp_get_file_dir): Declare. * files.cc (_cpp_get_file_dir): New fn. * mkdeps.cc (make_write): Use it. gcc/testsuite/ChangeLog: * g++.dg/modules/dep-4.H: New test.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/g++.dg/modules/dep-4.H7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/modules/dep-4.H b/gcc/testsuite/g++.dg/modules/dep-4.H
new file mode 100644
index 0000000..070fa5a
--- /dev/null
+++ b/gcc/testsuite/g++.dg/modules/dep-4.H
@@ -0,0 +1,7 @@
+// { dg-do preprocess }
+// { dg-additional-options "-fmodules -M" }
+
+inline void f() { }
+
+// { dg-final { scan-file dep-4.i {dep-4\.H\.c\+\+-header-unit:} } }
+// { dg-final { scan-file-not dep-4.i {inline} } }