252
|
1 // Tests that the declaration won't get emitted after being merged.
|
|
2 //
|
|
3 // RUN: rm -rf %t
|
|
4 // RUN: mkdir -p %t
|
|
5 // RUN: split-file %s %t
|
|
6 //
|
|
7 // RUN: %clang_cc1 -std=c++20 -triple %itanium_abi_triple %t/A.cppm -emit-module-interface -o %t/A.pcm
|
|
8 // RUN: %clang_cc1 -std=c++20 -triple %itanium_abi_triple %t/B.cppm -emit-module-interface -o %t/B.pcm \
|
|
9 // RUN: -fprebuilt-module-path=%t
|
|
10 // RUN: %clang_cc1 -std=c++20 -triple %itanium_abi_triple %t/B.pcm -S -emit-llvm -o - | FileCheck %t/B.cppm
|
|
11
|
|
12 //--- foo.h
|
|
13
|
|
14 template <class T>
|
|
15 class foo {
|
|
16 public:
|
|
17 T value;
|
|
18 T GetValue() { return value; }
|
|
19 };
|
|
20
|
|
21 template class foo<int>;
|
|
22
|
|
23 //--- A.cppm
|
|
24 module;
|
|
25 #include "foo.h"
|
|
26 export module A;
|
|
27 export using ::foo;
|
|
28
|
|
29 //--- B.cppm
|
|
30 module;
|
|
31 #include "foo.h"
|
|
32 export module B;
|
|
33 import A;
|
|
34 export using ::foo;
|
|
35 export int B() {
|
|
36 foo<int> f;
|
|
37 return f.GetValue();
|
|
38 }
|
|
39
|
|
40 // CHECK-NOT: define{{.*}}@_ZN3fooIiE8GetValueEv
|