blob: 5d70bc0840d5c814ad80b0f712c5322b4cd5c0f5 [file] [log] [blame]
Douglas Gregord620a842011-12-06 17:16:41 +00001// RUN: rm -rf %t
Douglas Gregor953a61f2013-02-07 19:01:24 +00002// RUN: %clang_cc1 -Wauto-import -fmodules-cache-path=%t -fmodules -F %S/Inputs -F %S/Inputs/DependsOnModule.framework/Frameworks %s -verify
3// RUN: %clang_cc1 -x objective-c++ -Wauto-import -fmodules-cache-path=%t -fmodules -F %S/Inputs -F %S/Inputs/DependsOnModule.framework/Frameworks %s -verify
Douglas Gregord620a842011-12-06 17:16:41 +00004
Douglas Gregor1b257af2012-12-11 22:11:52 +00005@import DependsOnModule;
Douglas Gregord620a842011-12-06 17:16:41 +00006
7void testSubFramework() {
Richard Smithd67679d2013-08-20 20:35:18 +00008 float *sf1 = sub_framework; // expected-error{{declaration of 'sub_framework' must be imported from module 'DependsOnModule.SubFramework' before it is required}}
9 // expected-note@Inputs/DependsOnModule.framework/Frameworks/SubFramework.framework/Headers/SubFramework.h:2 {{previous}}
Douglas Gregord620a842011-12-06 17:16:41 +000010}
11
Douglas Gregor1b257af2012-12-11 22:11:52 +000012@import DependsOnModule.SubFramework;
Douglas Gregord620a842011-12-06 17:16:41 +000013
14void testSubFrameworkAgain() {
15 float *sf2 = sub_framework;
16 double *sfo1 = sub_framework_other;
17}
18
Douglas Gregor51f564f2011-12-31 04:05:44 +000019#ifdef __cplusplus
Douglas Gregor1b257af2012-12-11 22:11:52 +000020@import DependsOnModule.CXX;
Douglas Gregor51f564f2011-12-31 04:05:44 +000021
22CXXOnly cxxonly;
23#endif
Douglas Gregor1b58c742013-02-08 00:10:48 +000024
25@import HasSubModules;
26
Andy Gibbsb42f2002013-04-17 08:06:46 +000027// expected-warning@Inputs/HasSubModules.framework/Frameworks/Sub.framework/PrivateHeaders/SubPriv.h:1{{treating #include as an import of module 'HasSubModules.Sub.Types'}}
Douglas Gregor1b58c742013-02-08 00:10:48 +000028#import <HasSubModules/HasSubModulesPriv.h>
29
30struct FrameworkSubStruct ss;