summaryrefslogtreecommitdiffstats
path: root/clang/test/Modules
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-09-12 23:31:24 +0000
committerDouglas Gregor <dgregor@apple.com>2011-09-12 23:31:24 +0000
commitfaeb1d46586271ab1b8a0158cbd5073ef0c6abca (patch)
tree8aacb49a399f80b3c93ee1279e7d8fa0a20e5aac /clang/test/Modules
parentd4a2b37091486619386db4ccd0b1698fba8db92c (diff)
downloadbcm5719-llvm-faeb1d46586271ab1b8a0158cbd5073ef0c6abca.tar.gz
bcm5719-llvm-faeb1d46586271ab1b8a0158cbd5073ef0c6abca.zip
When an import statement fails to find a module in the module cache,
but there is a corresponding umbrella header in a framework, build the module on-the-fly so it can be immediately loaded at the import statement. This is very much proof-of-concept code, with details to be fleshed out over time. llvm-svn: 139558
Diffstat (limited to 'clang/test/Modules')
-rw-r--r--clang/test/Modules/Inputs/Module.framework/Headers/Module.h6
-rw-r--r--clang/test/Modules/on-demand-build.m11
2 files changed, 17 insertions, 0 deletions
diff --git a/clang/test/Modules/Inputs/Module.framework/Headers/Module.h b/clang/test/Modules/Inputs/Module.framework/Headers/Module.h
new file mode 100644
index 00000000000..1d9278b0ca1
--- /dev/null
+++ b/clang/test/Modules/Inputs/Module.framework/Headers/Module.h
@@ -0,0 +1,6 @@
+const char *getModuleVersion(void);
+
+@interface Module
++(const char *)version;
+@end
+
diff --git a/clang/test/Modules/on-demand-build.m b/clang/test/Modules/on-demand-build.m
new file mode 100644
index 00000000000..2191499cec3
--- /dev/null
+++ b/clang/test/Modules/on-demand-build.m
@@ -0,0 +1,11 @@
+// RUN: mkdir -p %t
+// RUN: rm -f %t/Module.pcm
+// RUN: %clang_cc1 -fmodule-cache-path %t -F %S/Inputs -verify %s
+
+__import_module__ Module;
+void test_getModuleVersion() {
+ int version = getModuleVersion(); // expected-warning{{incompatible pointer to integer conversion initializing 'int' with an expression of type 'const char *'}}
+ int version2 = [Module version]; // expected-warning{{incompatible pointer to integer conversion initializing 'int' with an expression of type 'const char *'}}
+}
+
+
OpenPOWER on IntegriCloud