42 lines · plain
1// RUN: rm -rf %t2// RUN: mkdir -p %t3// RUN: split-file %s %t4//5// RUN: %clang_cc1 -std=c++20 %t/mod1.cppm -emit-module-interface -o %t/mod1.pcm6// RUN: %clang_cc1 -std=c++20 %t/mod2.cppm -emit-module-interface -o %t/mod2.pcm \7// RUN: -fprebuilt-module-path=%t8// RUN: %clang_cc1 -std=c++20 %t/mod3.cppm -fsyntax-only -verify \9// RUN: -fprebuilt-module-path=%t10 11// RUN: %clang_cc1 -std=c++20 %t/mod1.cppm -emit-obj -o %t/mod1.o -fmodule-output=%t/mod1.pcm12// RUN: %clang_cc1 -std=c++20 %t/mod2.cppm -emit-obj -o %t/mod2.o -fmodule-output=%t/mod2.pcm \13// RUN: -fprebuilt-module-path=%t14// RUN: %clang_cc1 -std=c++20 %t/mod3.cppm -fsyntax-only -verify \15// RUN: -fprebuilt-module-path=%t16 17//--- mod1.cppm18export module mod1;19 20export template<class T>21T mod1_f(T x) {22 return x;23}24 25//--- mod2.cppm26export module mod2;27import mod1;28 29export template<class U>30U mod2_g(U y) {31 return mod1_f(y);32}33 34//--- mod3.cppm35// expected-no-diagnostics36export module mod3;37import mod2;38 39export int mod3_h(int p) {40 return mod2_g(p);41}42