Douglas Gregor | 6e975c4 | 2011-09-13 23:15:45 +0000 | [diff] [blame] | 1 | // RUN: rm -rf %t |
Douglas Gregor | 05edf66 | 2011-10-17 14:55:37 +0000 | [diff] [blame^] | 2 | // RUN: %clang_cc1 -fno-objc-infer-related-result-type -Werror -fmodule-cache-path %t -F %S/Inputs -verify %s |
| 3 | // RUN: %clang_cc1 -fno-objc-infer-related-result-type -Werror -x objective-c++ -fmodule-cache-path %t -F %S/Inputs -verify %s |
| 4 | // RUN: %clang_cc1 -fno-objc-infer-related-result-type -Werror -fmodule-cache-path %t -F %S/Inputs -verify %s |
| 5 | #define FOO |
Douglas Gregor | 21cae20 | 2011-09-12 23:31:24 +0000 | [diff] [blame] | 6 | __import_module__ Module; |
Douglas Gregor | 0f50b08 | 2011-09-15 14:56:27 +0000 | [diff] [blame] | 7 | @interface OtherClass |
| 8 | @end |
| 9 | // in module: expected-note{{class method 'alloc' is assumed to return an instance of its receiver type ('Module *')}} |
Douglas Gregor | 21cae20 | 2011-09-12 23:31:24 +0000 | [diff] [blame] | 10 | void test_getModuleVersion() { |
Douglas Gregor | 6e975c4 | 2011-09-13 23:15:45 +0000 | [diff] [blame] | 11 | const char *version = getModuleVersion(); |
| 12 | const char *version2 = [Module version]; |
Douglas Gregor | 0f50b08 | 2011-09-15 14:56:27 +0000 | [diff] [blame] | 13 | |
| 14 | OtherClass *other = [Module alloc]; // expected-error{{init}} |
Douglas Gregor | 21cae20 | 2011-09-12 23:31:24 +0000 | [diff] [blame] | 15 | } |
| 16 | |
| 17 | |