aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/Modules/Inputs/Module.framework/Headers/Module.h1
-rw-r--r--test/Modules/on-demand-build.m11
2 files changed, 9 insertions, 3 deletions
diff --git a/test/Modules/Inputs/Module.framework/Headers/Module.h b/test/Modules/Inputs/Module.framework/Headers/Module.h
index af403c8395..0753b78cdb 100644
--- a/test/Modules/Inputs/Module.framework/Headers/Module.h
+++ b/test/Modules/Inputs/Module.framework/Headers/Module.h
@@ -6,5 +6,6 @@ const char *getModuleVersion(void);
@interface Module
+(const char *)version; // retrieve module version
++alloc;
@end
diff --git a/test/Modules/on-demand-build.m b/test/Modules/on-demand-build.m
index d0557ebbee..418e912f63 100644
--- a/test/Modules/on-demand-build.m
+++ b/test/Modules/on-demand-build.m
@@ -1,12 +1,17 @@
// RUN: rm -rf %t
-// RUN: %clang_cc1 -fmodule-cache-path %t -F %S/Inputs -DFOO -verify %s
-// RUN: %clang_cc1 -x objective-c++ -fmodule-cache-path %t -F %S/Inputs -DFOO -verify %s
-// RUN: %clang_cc1 -fmodule-cache-path %t -F %S/Inputs -DFOO -verify %s
+// RUN: %clang_cc1 -fno-objc-infer-related-result-type -Werror -fmodule-cache-path %t -F %S/Inputs -DFOO -verify %s
+// RUN: %clang_cc1 -fno-objc-infer-related-result-type -Werror -x objective-c++ -fmodule-cache-path %t -F %S/Inputs -DFOO -verify %s
+// RUN: %clang_cc1 -fno-objc-infer-related-result-type -Werror -fmodule-cache-path %t -F %S/Inputs -DFOO -verify %s
__import_module__ Module;
+@interface OtherClass
+@end
+// in module: expected-note{{class method 'alloc' is assumed to return an instance of its receiver type ('Module *')}}
void test_getModuleVersion() {
const char *version = getModuleVersion();
const char *version2 = [Module version];
+
+ OtherClass *other = [Module alloc]; // expected-error{{init}}
}