Introduce builtin macros to determine whether we're building a
specific module (__building_module(modulename)) and to get the name of
the current module as an identifier (__MODULE__).
Used to help headers behave differently when they're being included as
part of building a module. Oh, the irony.
llvm-svn: 164605
diff --git a/clang/test/Modules/Inputs/macros.h b/clang/test/Modules/Inputs/macros.h
index 4f53556..27f43c0 100644
--- a/clang/test/Modules/Inputs/macros.h
+++ b/clang/test/Modules/Inputs/macros.h
@@ -8,3 +8,12 @@
#__private_macro MODULE
int (INTEGER);
+
+#if !__building_module(macros)
+# error Can't include this header without building the 'macros' module.
+#endif
+
+#ifdef __MODULE__
+extern int __MODULE__;
+#endif
+