59 lines · plain
1// RUN: rm -rf %t2// RUN: mkdir -p %t3// RUN: split-file %s %t4 5// RUN: %clang_cc1 -std=c++20 %t/b.cppm -emit-module-interface -o %t/b.pcm6// RUN: %clang_cc1 -std=c++20 %t/a.cppm -emit-module-interface -o %t/a.pcm \7// RUN: -fmodule-file=a:b=%t/b.pcm8// RUN: %clang_cc1 -std=c++20 %t/c.cppm -emit-module-interface -o %t/c.pcm \9// RUN: -fmodule-file=a:b=%t/b.pcm -fmodule-file=a=%t/a.pcm10 11// RUN: %clang_cc1 -std=c++20 %t/b.cppm -emit-reduced-module-interface -o %t/b.pcm12// RUN: %clang_cc1 -std=c++20 %t/a.cppm -emit-reduced-module-interface -o %t/a.pcm \13// RUN: -fmodule-file=a:b=%t/b.pcm14// RUN: %clang_cc1 -std=c++20 %t/c.cppm -emit-reduced-module-interface -o %t/c.pcm \15// RUN: -fmodule-file=a:b=%t/b.pcm -fmodule-file=a=%t/a.pcm16 17 18//--- b.cppm19export module a:b;20class Polymorphic {21public:22 virtual ~Polymorphic() = default;23};24 25//--- a.h26namespace std {27using X = int;28}29 30namespace a {31 using std::X;32}33 34//--- a.cppm35module;36#include "a.h"37export module a;38import :b;39std::X var;40namespace std {41 export using std::X;42}43namespace a {44 export using std::X;45}46 47//--- c.cppm48export module c;49import a;50namespace a {51 export using std::X;52}53 54namespace a {55 X test() {56 return X{};57 }58}59