53 lines · plain
1// RUN: rm -rf %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.pcm7// RUN: %clang_cc1 -std=c++20 %t/M.cppm -emit-module-interface -o %t/M.pcm \8// RUN: -fprebuilt-module-path=%t9// RUN: %clang_cc1 -std=c++20 %t/Use.cpp -fsyntax-only -fprebuilt-module-path=%t -verify10 11// Test again with reduced BMI.12// RUN: rm -rf %t13// RUN: mkdir %t14// RUN: split-file %s %t15//16// RUN: %clang_cc1 -std=c++20 %t/A.cppm -emit-reduced-module-interface -o %t/M-A.pcm17// RUN: %clang_cc1 -std=c++20 %t/B.cppm -emit-reduced-module-interface -o %t/M-B.pcm18// RUN: %clang_cc1 -std=c++20 %t/M.cppm -emit-reduced-module-interface -o %t/M.pcm \19// RUN: -fprebuilt-module-path=%t20// RUN: %clang_cc1 -std=c++20 %t/Use.cpp -fsyntax-only -fprebuilt-module-path=%t -verify21 22 23//--- foo.h24template <typename T>25class Templ {26public:27 Templ(T a) {}28};29 30//--- A.cppm31module;32#include "foo.h"33export module M:A;34export using ::Templ;35 36//--- B.cppm37module;38#include "foo.h"39export module M:B;40 41//--- M.cppm42export module M;43export import :A;44export import :B;45 46//--- Use.cpp47// expected-no-diagnostics48import M;49 50void func() {51 Templ t(5);52}53