blob: ce35415717d2cc3f4742073b48ee6ff6924bd1fa [file] [log] [blame]
Douglas Gregorf2161a72011-12-06 17:16:41 +00001// RUN: rm -rf %t
Bruno Cardoso Lopes297299192017-12-22 02:53:30 +00002// RUN: %clang_cc1 -Wauto-import -Wno-private-module -fmodules-cache-path=%t -fmodules -fimplicit-module-maps -F %S/Inputs -F %S/Inputs/DependsOnModule.framework/Frameworks %s -verify
3// RUN: %clang_cc1 -x objective-c++ -Wauto-import -Wno-private-module -fmodules-cache-path=%t -fmodules -fimplicit-module-maps -F %S/Inputs -F %S/Inputs/DependsOnModule.framework/Frameworks %s -verify
Douglas Gregorf2161a72011-12-06 17:16:41 +00004
Douglas Gregorc50d4922012-12-11 22:11:52 +00005@import DependsOnModule;
Douglas Gregorf2161a72011-12-06 17:16:41 +00006
7void testSubFramework() {
Richard Smithe156254d2013-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 Gregorf2161a72011-12-06 17:16:41 +000010}
11
Douglas Gregorc50d4922012-12-11 22:11:52 +000012@import DependsOnModule.SubFramework;
Douglas Gregorf2161a72011-12-06 17:16:41 +000013
14void testSubFrameworkAgain() {
15 float *sf2 = sub_framework;
16 double *sfo1 = sub_framework_other;
17}
18
Douglas Gregor1fb5c3a2011-12-31 04:05:44 +000019#ifdef __cplusplus
Douglas Gregorc50d4922012-12-11 22:11:52 +000020@import DependsOnModule.CXX;
Douglas Gregor1fb5c3a2011-12-31 04:05:44 +000021
22CXXOnly cxxonly;
23#endif
Douglas Gregorf5f94522013-02-08 00:10:48 +000024
25@import HasSubModules;
26
Andy Gibbsfcc699a2013-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 Gregorf5f94522013-02-08 00:10:48 +000028#import <HasSubModules/HasSubModulesPriv.h>
29
30struct FrameworkSubStruct ss;