35 lines · plain
1// RUN: rm -rf %t2// RUN: mkdir -p %t3// RUN: split-file %s %t4//5// RUN: %clang_cc1 -std=c++20 %t/module1.cppm -emit-module-interface -o %t/module1.pcm6// RUN: %clang_cc1 -std=c++20 -fmodule-file=module1=%t/module1.pcm %t/module2.cppm \7// RUN: -emit-module-interface -o %t/module2.pcm8// RUN: %clang_cc1 -std=c++20 %t/module2.pcm -fmodule-file=module1=%t/module1.pcm \9// RUN: -emit-llvm -o - | FileCheck %t/module2.cppm10 11//--- test.h12template<typename T>13struct Test {14 template<typename U>15 friend class Test;16};17 18//--- module1.cppm19module;20#include "test.h"21export module module1;22export void f1(Test<int>) {}23 24//--- module2.cppm25module;26#include "test.h"27export module module2;28import module1;29export void f2(Test<float>) {}30 31extern "C" void func() {}32 33// Fine enough to check the IR is emitted correctly.34// CHECK: define{{.*}}@func35