xref: /llvm-project/clang/test/Modules/no-implicit-std-cxx-module.cppm (revision dc4e85bd79ff17014cbbe4a9db1d9b91929e91ce)
1// RUN: rm -rf %t
2// RUN: split-file %s %t
3// RUN: cd %t
4//
5// RUN: %clang_cc1 -std=c++20 -emit-module-interface %t/b.cppm -o %t/b.pcm
6// RUN: %clang_cc1 -std=c++20 -emit-module-interface %t/a.cppm -fmodule-file=b=%t/b.pcm \
7// RUN:     -o %t/a.pcm
8// RUN: %clang_cc1 -std=c++20 %t/user.cpp -fmodule-file=a=%t/a.pcm -verify -fsyntax-only
9
10//--- b.cppm
11export module b;
12export int b() {
13    return 43;
14}
15
16//--- a.cppm
17export module a;
18import b;
19export int a() {
20    return b() + 43;
21}
22
23//--- user.cpp
24import a; // expected-error {{failed to find module file for module 'b'}}
25int use() {
26    return a(); // expected-error {{use of undeclared identifier 'a'}}
27}
28