aboutsummaryrefslogtreecommitdiff
path: root/clang/test/Modules/vtable-in-explicit-instantiation.cppm
blob: b090607751744c71ff0140912e29309d2688035f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// RUN: rm -rf %t
// RUN: mkdir %t
// RUN: split-file %s %t

// RUN: %clang_cc1 -std=c++20 %t/a.cppm -triple %itanium_abi_triple -emit-module-interface -o %t/a.pcm
// RUN: %clang_cc1 -std=c++20 %t/a.cc -triple %itanium_abi_triple -fmodule-file=a=%t/a.pcm -emit-llvm -o - | FileCheck %t/a.cc
//
// RUN: %clang_cc1 -std=c++20 %t/a.cppm -triple %itanium_abi_triple -emit-reduced-module-interface -o %t/a.pcm
// RUN: %clang_cc1 -std=c++20 %t/a.cc -triple %itanium_abi_triple -fmodule-file=a=%t/a.pcm -emit-llvm -o - | FileCheck %t/a.cc

//--- a.cppm
export module a;
class base {
public:
    ~base() = default;
    virtual void foo();
};

template <class T>
class a : public base {
public:
    virtual void foo() override;
};

extern template class a<int>;

//--- a.cc
module a;

template <class T>
void a<T>::foo() {}

template class a<int>;
// CHECK: _ZTVW1a1aIiE