2011-09-14 07:15:45 +08:00
|
|
|
// RUN: rm -rf %t
|
2011-10-17 22:55:37 +08:00
|
|
|
// RUN: %clang_cc1 -fno-objc-infer-related-result-type -Werror -fmodule-cache-path %t -F %S/Inputs -verify %s
|
|
|
|
// RUN: %clang_cc1 -fno-objc-infer-related-result-type -Werror -x objective-c++ -fmodule-cache-path %t -F %S/Inputs -verify %s
|
|
|
|
// RUN: %clang_cc1 -fno-objc-infer-related-result-type -Werror -fmodule-cache-path %t -F %S/Inputs -verify %s
|
|
|
|
#define FOO
|
2011-09-13 07:31:24 +08:00
|
|
|
__import_module__ Module;
|
2011-09-15 22:56:27 +08:00
|
|
|
@interface OtherClass
|
|
|
|
@end
|
2011-10-17 23:32:29 +08:00
|
|
|
|
|
|
|
|
2011-09-15 22:56:27 +08:00
|
|
|
// in module: expected-note{{class method 'alloc' is assumed to return an instance of its receiver type ('Module *')}}
|
2011-09-13 07:31:24 +08:00
|
|
|
void test_getModuleVersion() {
|
2011-09-14 07:15:45 +08:00
|
|
|
const char *version = getModuleVersion();
|
|
|
|
const char *version2 = [Module version];
|
2011-09-15 22:56:27 +08:00
|
|
|
|
|
|
|
OtherClass *other = [Module alloc]; // expected-error{{init}}
|
2011-09-13 07:31:24 +08:00
|
|
|
}
|
|
|
|
|
2011-10-17 23:32:29 +08:00
|
|
|
#ifdef MODULE_H
|
|
|
|
# error MODULE_H should not be hidden
|
|
|
|
#endif
|
2011-09-13 07:31:24 +08:00
|
|
|
|