60 lines · plain
1// RUN: rm -fr %t2// RUN: mkdir %t3// RUN: split-file %s %t4//5// RUN: %clang_cc1 -std=c++20 %t/a.cppm -emit-module-interface -o %t/m-a.pcm6// RUN: %clang_cc1 -std=c++20 %t/b.cppm -emit-module-interface -o %t/m-b.pcm \7// RUN: -fprebuilt-module-path=%t8// RUN: %clang_cc1 -std=c++20 %t/m.cppm -emit-module-interface -o %t/m.pcm \9// RUN: -fprebuilt-module-path=%t10// RUN: %clang_cc1 -std=c++20 %t/use.cppm -fprebuilt-module-path=%t -emit-obj11 12// Test again with reduced BMI.13// RUN: rm -fr %t14// RUN: mkdir %t15// RUN: split-file %s %t16//17// RUN: %clang_cc1 -std=c++20 %t/a.cppm -emit-reduced-module-interface -o %t/m-a.pcm18// RUN: %clang_cc1 -std=c++20 %t/b.cppm -emit-reduced-module-interface -o %t/m-b.pcm \19// RUN: -fprebuilt-module-path=%t20// RUN: %clang_cc1 -std=c++20 %t/m.cppm -emit-reduced-module-interface -o %t/m.pcm \21// RUN: -fprebuilt-module-path=%t22// RUN: %clang_cc1 -std=c++20 %t/use.cppm -fprebuilt-module-path=%t -emit-obj23 24 25//--- a.cppm26export module m:a;27namespace n {28export class a {29public:30 virtual ~a() {}31};32}33 34//--- b.cppm35export module m:b;36namespace n {37class a;38}39 40//--- m.cppm41export module m;42export import :a;43export import :b;44 45//--- use.cppm46// expected-no-diagnostics47export module u;48export import m;49 50struct aa : public n::a {51 aa() {}52};53auto foo(n::a*) {54 return;55}56 57void use() {58 n::a _;59}60