13 lines · cpp
1// This tests that the compiler wouldn't crash if the module path misses2 3// RUN: rm -rf %t4// RUN: mkdir -p %t/subdir5// RUN: echo "export module C;" >> %t/subdir/C.cppm6// RUN: echo -e "export module B;\nimport C;" >> %t/B.cppm7// RUN: %clang_cc1 -std=c++20 -emit-module-interface %t/subdir/C.cppm -o %t/subdir/C.pcm8// RUN: %clang_cc1 -std=c++20 -emit-module-interface -fprebuilt-module-path=%t/subdir %t/B.cppm -o %t/B.pcm9// RUN: %clang_cc1 -std=c++20 -fmodule-file=B=%t/B.pcm %s -fsyntax-only -verify10 11import B; // expected-error {{failed to find module file for module 'C'}}12import C; // expected-error {{module 'C' not found}}13