Douglas Gregor | fba18aa | 2011-09-15 22:00:41 +0000 | [diff] [blame] | 1 | |
| 2 | // RUN: rm -rf %t |
Douglas Gregor | e3a8256 | 2011-11-30 18:02:36 +0000 | [diff] [blame] | 3 | // RUN: %clang_cc1 -x objective-c -Wauto-import -fmodule-cache-path %t -fauto-module-import -F %S/Inputs %s -verify |
Douglas Gregor | fba18aa | 2011-09-15 22:00:41 +0000 | [diff] [blame] | 4 | |
Douglas Gregor | e3a8256 | 2011-11-30 18:02:36 +0000 | [diff] [blame] | 5 | #include <DependsOnModule/DependsOnModule.h> // expected-warning{{treating #include as an import of module 'DependsOnModule'}} |
Douglas Gregor | fba18aa | 2011-09-15 22:00:41 +0000 | [diff] [blame] | 6 | |
| 7 | #ifdef MODULE_H_MACRO |
| 8 | # error MODULE_H_MACRO should have been hidden |
| 9 | #endif |
| 10 | |
| 11 | #ifdef DEPENDS_ON_MODULE |
| 12 | # error DEPENDS_ON_MODULE should have been hidden |
| 13 | #endif |
Douglas Gregor | ecc2c09 | 2011-12-01 22:20:10 +0000 | [diff] [blame] | 14 | |
Douglas Gregor | 209977c | 2011-12-05 17:40:25 +0000 | [diff] [blame] | 15 | Module *mod; // expected-error{{unknown type name 'Module'}} |
| 16 | |
| 17 | #import <AlsoDependsOnModule/AlsoDependsOnModule.h> // expected-warning{{treating #import as an import of module 'AlsoDependsOnModule'}} |
| 18 | Module *mod2; |
| 19 | |
Douglas Gregor | 8075ce6 | 2011-12-06 17:15:11 +0000 | [diff] [blame] | 20 | int getDependsOther() { return depends_on_module_other; } |
Douglas Gregor | 0983392 | 2011-12-06 17:31:28 +0000 | [diff] [blame^] | 21 | |
| 22 | void testSubframeworkOther() { |
| 23 | double *sfo1 = sub_framework_other; // expected-error{{use of undeclared identifier 'sub_framework_other'}} |
| 24 | } |
| 25 | |
| 26 | // Test header cross-subframework include pattern. |
| 27 | #include <DependsOnModule/../Frameworks/SubFramework.framework/Headers/Other.h> // expected-warning{{treating #include as an import of module 'DependsOnModule.SubFramework'}} |
| 28 | |
| 29 | void testSubframeworkOtherAgain() { |
| 30 | double *sfo1 = sub_framework_other; |
| 31 | } |