llvm-capstone/clang/test/Modules/implicit-module-with-missing-path.cpp
Chuanqi Xu e22fa1d4c6 [C++20] [Modules] Emit a warning if the we load the modules by implicit generated path
A step to address https://github.com/llvm/llvm-project/issues/62707.

It is not user friendly enough to drop the implicitly generated path
directly. Let's emit the warning first and drop it in the next version.
2023-05-17 17:53:36 +08:00

13 lines
673 B
C++

// This tests that the compiler wouldn't crash if the module path misses
// RUN: rm -rf %t
// RUN: mkdir -p %t/subdir
// RUN: echo "export module C;" >> %t/subdir/C.cppm
// RUN: echo -e "export module B;\nimport C;" >> %t/B.cppm
// RUN: %clang_cc1 -std=c++20 -emit-module-interface %t/subdir/C.cppm -o %t/subdir/C.pcm
// RUN: %clang_cc1 -std=c++20 -emit-module-interface -fprebuilt-module-path=%t/subdir %t/B.cppm -o %t/B.pcm
// RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %s -fsyntax-only -verify -Wno-read-modules-implicitly
import B;
import C; // expected-error {{module 'C' is needed but has not been provided, and implicit use of module files is disabled}}