annotate clang/test/VFS/real-path-found-first.m @ 207:2e18cbf3894f

LLVM12
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 08 Jun 2021 06:07:14 +0900
parents 1d019706d866
children c4bab56944e8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // This test is for cases where we lookup a file by its 'real' path before we
anatofuz
parents:
diff changeset
2 // use its VFS-mapped path. If we accidentally use the real path in header
anatofuz
parents:
diff changeset
3 // search, we will not find a module for the headers. To test that we
anatofuz
parents:
diff changeset
4 // intentionally rebuild modules, since the precompiled module file refers to
anatofuz
parents:
diff changeset
5 // the dependency files by real path.
anatofuz
parents:
diff changeset
6
anatofuz
parents:
diff changeset
7 // RUN: rm -rf %t %t-cache %t.pch
anatofuz
parents:
diff changeset
8 // RUN: mkdir -p %t/SomeFramework.framework/Modules
anatofuz
parents:
diff changeset
9 // RUN: cat %S/Inputs/some_frame_module.map > %t/SomeFramework.framework/Modules/module.modulemap
anatofuz
parents:
diff changeset
10 // RUN: sed -e "s@INPUT_DIR@%{/S:regex_replacement}/Inputs@g" -e "s@OUT_DIR@%{/t:regex_replacement}@g" %S/Inputs/vfsoverlay.yaml > %t.yaml
anatofuz
parents:
diff changeset
11
anatofuz
parents:
diff changeset
12 // Build
anatofuz
parents:
diff changeset
13 // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t-cache -F %t \
anatofuz
parents:
diff changeset
14 // RUN: -ivfsoverlay %t.yaml -fsyntax-only %s -verify -Wauto-import \
anatofuz
parents:
diff changeset
15 // RUN: -Werror=non-modular-include-in-framework-module
anatofuz
parents:
diff changeset
16
anatofuz
parents:
diff changeset
17 // Rebuild
anatofuz
parents:
diff changeset
18 // RUN: echo ' ' >> %t/SomeFramework.framework/Modules/module.modulemap
anatofuz
parents:
diff changeset
19 // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t-cache -F %t \
anatofuz
parents:
diff changeset
20 // RUN: -ivfsoverlay %t.yaml -fsyntax-only %s -verify -Wauto-import \
anatofuz
parents:
diff changeset
21 // RUN: -Werror=non-modular-include-in-framework-module
anatofuz
parents:
diff changeset
22
anatofuz
parents:
diff changeset
23 // Load from PCH
anatofuz
parents:
diff changeset
24 // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t-cache -F %t \
anatofuz
parents:
diff changeset
25 // RUN: -ivfsoverlay %t.yaml -emit-pch %s -o %t.pch \
anatofuz
parents:
diff changeset
26 // RUN: -Werror=non-modular-include-in-framework-module \
anatofuz
parents:
diff changeset
27 // RUN: -fmodules-ignore-macro=WITH_PREFIX
anatofuz
parents:
diff changeset
28 // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t-cache -F %t \
anatofuz
parents:
diff changeset
29 // RUN: -ivfsoverlay %t.yaml -include-pch %t.pch -fsyntax-only %s \
anatofuz
parents:
diff changeset
30 // RUN: -Werror=non-modular-include-in-framework-module -DWITH_PREFIX \
anatofuz
parents:
diff changeset
31 // RUN: -fmodules-ignore-macro=WITH_PREFIX
anatofuz
parents:
diff changeset
32
anatofuz
parents:
diff changeset
33 // While indexing
anatofuz
parents:
diff changeset
34 // RUN: c-index-test -index-file %s -fmodules -fimplicit-module-maps -fmodules-cache-path=%t-cache -F %t \
anatofuz
parents:
diff changeset
35 // RUN: -ivfsoverlay %t.yaml -fsyntax-only -Wauto-import \
anatofuz
parents:
diff changeset
36 // RUN: -Werror=non-modular-include-in-framework-module | FileCheck %s
anatofuz
parents:
diff changeset
37 // RUN: echo ' ' >> %t/SomeFramework.framework/Modules/module.modulemap
anatofuz
parents:
diff changeset
38 // RUN: c-index-test -index-file %s -fmodules -fimplicit-module-maps -fmodules-cache-path=%t-cache -F %t \
anatofuz
parents:
diff changeset
39 // RUN: -ivfsoverlay %t.yaml -fsyntax-only -Wauto-import \
anatofuz
parents:
diff changeset
40 // RUN: -Werror=non-modular-include-in-framework-module | FileCheck %s
anatofuz
parents:
diff changeset
41 // CHECK: warning: treating
anatofuz
parents:
diff changeset
42 // CHECK-NOT: error
anatofuz
parents:
diff changeset
43
anatofuz
parents:
diff changeset
44 // With a VFS-mapped module map file
anatofuz
parents:
diff changeset
45 // RUN: mv %t/SomeFramework.framework/Modules/module.modulemap %t/hide_module.map
anatofuz
parents:
diff changeset
46 // RUN: echo "{ 'version': 0, 'roots': [ { " > %t2.yaml
anatofuz
parents:
diff changeset
47 // RUN: echo "'name': '%t/SomeFramework.framework/Modules/module.modulemap'," >> %t2.yaml
anatofuz
parents:
diff changeset
48 // RUN: echo "'type': 'file', 'external-contents': '%t/hide_module.map' } ] }" >> %t2.yaml
anatofuz
parents:
diff changeset
49
anatofuz
parents:
diff changeset
50 // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t-cache -F %t \
anatofuz
parents:
diff changeset
51 // RUN: -ivfsoverlay %t.yaml -ivfsoverlay %t2.yaml -fsyntax-only %s -verify \
anatofuz
parents:
diff changeset
52 // RUN: -Wauto-import -Werror=non-modular-include-in-framework-module
anatofuz
parents:
diff changeset
53 // RUN: echo ' ' >> %t/hide_module.map
anatofuz
parents:
diff changeset
54 // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t-cache -F %t \
anatofuz
parents:
diff changeset
55 // RUN: -ivfsoverlay %t.yaml -ivfsoverlay %t2.yaml -fsyntax-only %s -verify \
anatofuz
parents:
diff changeset
56 // RUN: -Wauto-import -Werror=non-modular-include-in-framework-module
anatofuz
parents:
diff changeset
57
anatofuz
parents:
diff changeset
58 // Within a module build
anatofuz
parents:
diff changeset
59 // RUN: echo '@import import_some_frame;' | \
anatofuz
parents:
diff changeset
60 // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t-cache -F %t \
anatofuz
parents:
diff changeset
61 // RUN: -ivfsoverlay %t.yaml -ivfsoverlay %t2.yaml -fsyntax-only - \
anatofuz
parents:
diff changeset
62 // RUN: -Werror=non-modular-include-in-framework-module -x objective-c -I %t
anatofuz
parents:
diff changeset
63 // RUN: echo ' ' >> %t/hide_module.map
anatofuz
parents:
diff changeset
64 // RUN: echo '@import import_some_frame;' | \
anatofuz
parents:
diff changeset
65 // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t-cache -F %t \
anatofuz
parents:
diff changeset
66 // RUN: -ivfsoverlay %t.yaml -ivfsoverlay %t2.yaml -fsyntax-only - \
anatofuz
parents:
diff changeset
67 // RUN: -Werror=non-modular-include-in-framework-module -x objective-c -I %t
anatofuz
parents:
diff changeset
68
anatofuz
parents:
diff changeset
69 #ifndef WITH_PREFIX
anatofuz
parents:
diff changeset
70 #import <SomeFramework/public_header.h> // expected-warning{{treating}}
anatofuz
parents:
diff changeset
71 #import <SomeFramework/public_header2.h> // expected-warning{{treating}}
anatofuz
parents:
diff changeset
72 #import <SomeFramework/public_header3.h> // expected-warning{{treating}}
anatofuz
parents:
diff changeset
73 @import SomeFramework.public_header2;
anatofuz
parents:
diff changeset
74 #endif