Debian Codegraph @

clang/test/CodeGenCXX/cxx20-module-tmpl-1.cppm

raw
1 // RUN: %clang_cc1 -std=c++20 %s -triple %itanium_abi_triple -emit-llvm -o - | FileCheck %s
2
3 export module FOO;
4
5 class One;
6 class Two;
7
8 export template<typename T> struct TPL
9 {
10 void M (T *);
11 template<typename U> void N (T *, U*);
12 };
13
14 template<typename T>
15 void TPL<T>::M (T *) {}
16
17 template<typename T> template<typename U> void TPL<T>::N (T *, U*) {}
18
19 // CHECK-DAG: void @_ZNW3FOO3TPLIS_3OneE1MEPS1_(
20 template void TPL<One>::M (One *);
21 // CHECK-DAG: void @_ZNW3FOO3TPLIS_3OneE1NIS_3TwoEEvPS1_PT_(
22 template void TPL<One>::N<Two> (One *, Two *);
23
24 namespace NMS {
25 class One;
26 class Two;
27
28 export template<typename T> struct TPL
29 {
30 void M (T *);
31 template<typename U> void N (T *, U*);
32 };
33
34 template<typename T>
35 void TPL<T>::M (T *) {}
36
37 template<typename T> template<typename U> void TPL<T>::N (T *, U*) {}
38
39 // CHECK-DAG: void @_ZN3NMSW3FOO3TPLINS_S0_3OneEE1MEPS2_(
40 template void TPL<One>::M (One *);
41 // CHECK-DAG: void @_ZN3NMSW3FOO3TPLINS_S0_3OneEE1NINS_S0_3TwoEEEvPS2_PT_
42 template void TPL<One>::N<Two> (One *, Two *);
43 }