annotate clang/test/Modules/no-implicit-builds.cpp @ 266:00f31e85ec16 default tip

Added tag current for changeset 31d058e83c98
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sat, 14 Oct 2023 10:13:55 +0900
parents 1d019706d866
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // RUN: rm -rf %t
anatofuz
parents:
diff changeset
2
anatofuz
parents:
diff changeset
3 // RUN: %clang -x c++ -std=c++11 -fmodules -fno-implicit-modules /dev/null -### \
anatofuz
parents:
diff changeset
4 // RUN: 2>&1 | FileCheck --check-prefix=CHECK-NO-MODULE-CACHE %s
anatofuz
parents:
diff changeset
5 // CHECK-NO-MODULE-CACHE-NOT: -fmodules-cache-path
anatofuz
parents:
diff changeset
6
anatofuz
parents:
diff changeset
7 // Produce an error if a module is needed, but not found.
anatofuz
parents:
diff changeset
8 // RUN: %clang_cc1 -x c++ -std=c++11 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t \
anatofuz
parents:
diff changeset
9 // RUN: -fmodule-map-file=%S/Inputs/no-implicit-builds/b.modulemap \
anatofuz
parents:
diff changeset
10 // RUN: -fno-implicit-modules %s -verify
anatofuz
parents:
diff changeset
11 //
anatofuz
parents:
diff changeset
12 // Same thing if we're running -cc1 and no module cache path has been provided.
anatofuz
parents:
diff changeset
13 // RUN: %clang_cc1 -x c++ -std=c++11 -fmodules -fimplicit-module-maps \
anatofuz
parents:
diff changeset
14 // RUN: -fmodule-map-file=%S/Inputs/no-implicit-builds/b.modulemap \
anatofuz
parents:
diff changeset
15 // RUN: %s -verify
anatofuz
parents:
diff changeset
16
anatofuz
parents:
diff changeset
17 // Compile the module and put it into the cache.
anatofuz
parents:
diff changeset
18 // RUN: %clang_cc1 -x c++ -std=c++11 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t \
anatofuz
parents:
diff changeset
19 // RUN: -fmodule-map-file=%S/Inputs/no-implicit-builds/b.modulemap \
anatofuz
parents:
diff changeset
20 // RUN: %s -Rmodule-build 2>&1 | FileCheck --check-prefix=CHECK-CACHE-BUILD %s
anatofuz
parents:
diff changeset
21 // CHECK-CACHE-BUILD: {{building module 'b'}}
anatofuz
parents:
diff changeset
22
anatofuz
parents:
diff changeset
23 // Produce an error if a module is found in the cache but implicit modules is off.
anatofuz
parents:
diff changeset
24 // Note that the command line must match the command line for the first check, otherwise
anatofuz
parents:
diff changeset
25 // this check might not find the module in the cache and trivially succeed.
anatofuz
parents:
diff changeset
26 // RUN: %clang_cc1 -x c++ -std=c++11 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t \
anatofuz
parents:
diff changeset
27 // RUN: -fmodule-map-file=%S/Inputs/no-implicit-builds/b.modulemap \
anatofuz
parents:
diff changeset
28 // RUN: %s -Rmodule-build -fno-implicit-modules -verify
anatofuz
parents:
diff changeset
29
anatofuz
parents:
diff changeset
30 // Verify that we can still pass the module via -fmodule-file when implicit modules
anatofuz
parents:
diff changeset
31 // are switched off:
anatofuz
parents:
diff changeset
32 // - First, explicitly compile the module:
anatofuz
parents:
diff changeset
33 // RUN: %clang_cc1 -x c++ -std=c++11 -fmodules -fimplicit-module-maps -fmodule-name=b -o %t/b.pcm \
anatofuz
parents:
diff changeset
34 // RUN: -emit-module %S/Inputs/no-implicit-builds/b.modulemap \
anatofuz
parents:
diff changeset
35 // RUN: -fno-implicit-modules
anatofuz
parents:
diff changeset
36 //
anatofuz
parents:
diff changeset
37 // - Next, verify that we can load it:
anatofuz
parents:
diff changeset
38 // RUN: %clang_cc1 -x c++ -std=c++11 -fmodules -fimplicit-module-maps -fmodule-file=%t/b.pcm \
anatofuz
parents:
diff changeset
39 // RUN: -fmodule-map-file=%S/Inputs/no-implicit-builds/b.modulemap \
anatofuz
parents:
diff changeset
40 // RUN: -fno-implicit-modules %s
anatofuz
parents:
diff changeset
41
anatofuz
parents:
diff changeset
42 #include "Inputs/no-implicit-builds/b.h" // expected-error {{is needed but has not been provided}}