[modules] Properly attribute macros to modules if they're in a file textually included into a file in the module.

llvm-svn: 235661
diff --git a/clang/test/Modules/Inputs/macros-indirect.h b/clang/test/Modules/Inputs/macros-indirect.h
new file mode 100644
index 0000000..c90300e
--- /dev/null
+++ b/clang/test/Modules/Inputs/macros-indirect.h
@@ -0,0 +1 @@
+#define INDIRECTLY_IN_MACROS 1
diff --git a/clang/test/Modules/Inputs/macros.h b/clang/test/Modules/Inputs/macros.h
index 27f43c0..a0ae7a3 100644
--- a/clang/test/Modules/Inputs/macros.h
+++ b/clang/test/Modules/Inputs/macros.h
@@ -17,3 +17,4 @@
 extern int __MODULE__;
 #endif
 
+#include "macros-indirect.h"
diff --git a/clang/test/Modules/macros.c b/clang/test/Modules/macros.c
index 92ea88a4..3ca5300 100644
--- a/clang/test/Modules/macros.c
+++ b/clang/test/Modules/macros.c
@@ -28,6 +28,10 @@
 #  error MODULE macro should not be visible
 #endif
 
+#ifndef INDIRECTLY_IN_MACROS
+#  error INDIRECTLY_IN_MACROS should be visible
+#endif
+
 // CHECK-PREPROCESSED: double d
 double d;
 DOUBLE *dp = &d;