xref: /aosp_15_r20/external/clang/test/Modules/implementation-of-module.m (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li// RUN: rm -rf %t
2*67e74705SXin Li// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -w -Werror=auto-import %s -I %S/Inputs \
3*67e74705SXin Li// RUN:     -fmodule-implementation-of category_right -fsyntax-only
4*67e74705SXin Li
5*67e74705SXin Li// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -w -Werror=auto-import %s -I %S/Inputs \
6*67e74705SXin Li// RUN:     -fmodule-implementation-of category_right -dM -E -o - 2>&1 | FileCheck %s
7*67e74705SXin Li// CHECK-NOT: __building_module
8*67e74705SXin Li
9*67e74705SXin Li// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -w -Werror=auto-import %s -I %S/Inputs \
10*67e74705SXin Li// RUN:     -fmodule-implementation-of category_left -verify
11*67e74705SXin Li
12*67e74705SXin Li// RUN: %clang_cc1 -x objective-c-header -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -w -Werror=auto-import %s -I %S/Inputs \
13*67e74705SXin Li// RUN:     -fmodule-implementation-of category_right -emit-pch -o %t.pch
14*67e74705SXin Li// RUN: %clang_cc1 -x objective-c-header -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -w -Werror=auto-import %s -I %S/Inputs \
15*67e74705SXin Li// RUN:     -DWITH_PREFIX -fmodules-ignore-macro=WITH_PREFIX -include-pch %t.pch -fmodule-implementation-of category_right
16*67e74705SXin Li
17*67e74705SXin Li#ifndef WITH_PREFIX
18*67e74705SXin Li
19*67e74705SXin Li@import category_left; // expected-error{{@import of module 'category_left' in implementation of 'category_left'; use #import}}
20*67e74705SXin Li@import category_left.sub; // expected-error{{@import of module 'category_left.sub' in implementation of 'category_left'; use #import}}
21*67e74705SXin Li#import "category_right.h" // expected-error{{treating}}
22*67e74705SXin Li#import "category_right_sub.h" // expected-error{{treating}}
23*67e74705SXin Li
24*67e74705SXin Li#endif
25*67e74705SXin Li
26