on-demand-build.m revision 32ad2ee2618745ce3da51c2ae066ed5f21157c07
1// RUN: rm -rf %t
2// RUN: %clang_cc1 -fmodules -fno-objc-infer-related-result-type -Werror -Wno-error=incomplete-umbrella -fmodule-cache-path %t -F %S/Inputs -I %S/Inputs -verify %s
3// RUN: %clang_cc1 -fmodules -fno-objc-infer-related-result-type -Werror -Wno-error=incomplete-umbrella -x objective-c++ -fmodule-cache-path %t -F %S/Inputs -I %S/Inputs -verify %s
4// RUN: %clang_cc1 -fmodules -fno-objc-infer-related-result-type -Werror -Wno-error=incomplete-umbrella -fmodule-cache-path %t -F %S/Inputs -I %S/Inputs -verify %s
5#define FOO
6@__experimental_modules_import Module;
7@interface OtherClass
8@end
9
10
11
12
13// in module: expected-note{{class method 'alloc' is assumed to return an instance of its receiver type ('Module *')}}
14void test_getModuleVersion() {
15  const char *version = getModuleVersion();
16  const char *version2 = [Module version];
17
18  OtherClass *other = [Module alloc]; // expected-error{{init}}
19}
20
21#ifdef MODULE_SUBFRAMEWORK_H
22#  error MODULE_SUBFRAMEWORK_H should be hidden
23#endif
24
25@__experimental_modules_import subdir;
26
27const char *getSubdirTest() { return getSubdir(); }
28