28 lines · plain
1// RUN: rm -rf %t2// RUN: split-file %s %t3// RUN: cd %t4//5// RUN: %clang_cc1 -std=c++20 -emit-module-interface %t/b.cppm -o %t/b.pcm6// RUN: %clang_cc1 -std=c++20 -emit-module-interface %t/a.cppm -fmodule-file=b=%t/b.pcm \7// RUN: -o %t/a.pcm8// RUN: %clang_cc1 -std=c++20 %t/user.cpp -fmodule-file=a=%t/a.pcm -verify -fsyntax-only9 10//--- b.cppm11export module b;12export int b() {13 return 43;14}15 16//--- a.cppm17export module a;18import b;19export int a() {20 return b() + 43;21}22 23//--- user.cpp24import 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