blob: a7521fe78fcea202fd96a46639fec78ab5802eb9 [file] [log] [blame]
Douglas Gregor6e975c42011-09-13 23:15:45 +00001// RUN: rm -rf %t
Douglas Gregor8f95cb32012-01-29 16:43:46 +00002// 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
Douglas Gregor05edf662011-10-17 14:55:37 +00005#define FOO
Douglas Gregor5948ae12012-01-03 18:04:46 +00006@import Module;
Douglas Gregor0f50b082011-09-15 14:56:27 +00007@interface OtherClass
8@end
Douglas Gregoraa93a872011-10-17 15:32:29 +00009
10
Douglas Gregor585ec932011-12-23 00:23:59 +000011
12
Douglas Gregor0f50b082011-09-15 14:56:27 +000013// in module: expected-note{{class method 'alloc' is assumed to return an instance of its receiver type ('Module *')}}
Douglas Gregor21cae202011-09-12 23:31:24 +000014void test_getModuleVersion() {
Douglas Gregor6e975c42011-09-13 23:15:45 +000015 const char *version = getModuleVersion();
16 const char *version2 = [Module version];
Douglas Gregor0f50b082011-09-15 14:56:27 +000017
18 OtherClass *other = [Module alloc]; // expected-error{{init}}
Douglas Gregor21cae202011-09-12 23:31:24 +000019}
20
Douglas Gregorac252a32011-12-06 19:39:29 +000021#ifdef MODULE_SUBFRAMEWORK_H
22# error MODULE_SUBFRAMEWORK_H should be hidden
Douglas Gregoraa93a872011-10-17 15:32:29 +000023#endif
Douglas Gregor21cae202011-09-12 23:31:24 +000024
Douglas Gregor8f95cb32012-01-29 16:43:46 +000025@import subdir;
26
27const char *getSubdirTest() { return getSubdir(); }