Debian Codegraph @

clang/test/Modules/implicit-private-with-submodule-explicit.m

raw
1 // Checks that the use of .Private to refer to _Private modules works with an
2 // explicit module.
3
4 // RUN: rm -rf %t
5 // RUN: split-file %s %t
6
7 // RUN: %clang_cc1 -x objective-c -fmodules -fno-implicit-modules -emit-module -fmodule-name=A %t/module.modulemap -o %t/A.pcm
8 // RUN: %clang_cc1 -x objective-c -fmodules -fno-implicit-modules -emit-module -fmodule-name=A_Private %t/module.modulemap -o %t/A_Private.pcm
9
10 // Check lazily-loaded module
11 // RUN: %clang_cc1 -x objective-c -verify -fmodules -fno-implicit-modules -fmodule-file=A=%t/A.pcm -fmodule-file=A_Private=%t/A_Private.pcm -fsyntax-only %t/tu.m
12
13 // Check eagerly-loaded module
14 // RUN: %clang_cc1 -x objective-c -verify -fmodules -fno-implicit-modules -fmodule-file=%t/A.pcm -fmodule-file=%t/A_Private.pcm -fsyntax-only %t/tu.m
15
16 //--- module.modulemap
17 module A { header "a.h" }
18 module A_Private { header "priv.h" }
19
20 //--- a.h
21
22 //--- priv.h
23 void priv(void);
24
25 //--- tu.m
26 @import A.Private; // expected-warning{{no submodule named 'Private' in module 'A'; using top level 'A_Private'}}
27 // expected-note@*:* {{defined here}}
28
29 void tu(void) {
30 priv();
31 }