40 lines · plain
1// RUN: rm -rf %t2// RUN: mkdir -p %t3// RUN: split-file %s %t4//5// RUN: %clang_cc1 -std=c++20 %t/a.cppm -dwarf-version=4 -debug-info-kind=constructor \6// RUN: -emit-module-interface -o %t/a.pcm7// RUN: %clang_cc1 -std=c++20 %t/b.cppm -dwarf-version=4 -debug-info-kind=constructor \8// RUN: -emit-module-interface -o %t/b.pcm -fmodule-file=a=%t/a.pcm9// RUN: %clang_cc1 -std=c++20 %t/b.cpp -dwarf-version=4 -debug-info-kind=constructor \10// RUN: -emit-llvm -o - -fmodule-file=a=%t/a.pcm -fmodule-file=b=%t/b.pcm | FileCheck %t/b.cpp 11 12//--- a.cppm13export module a;14export template <class T>15class a {16private:17 T *data;18 19public:20 virtual T* getData();21};22 23extern template class a<char>;24 25//--- b.cppm26export module b;27import a;28export struct b {29 a<char> v;30};31 32//--- b.cpp33module b;34extern "C" void func() {35 b();36}37 38// It is fine enough to check that we won't crash.39// CHECK: define {{.*}}void @func()40