| 1 |
// RUN: %clang_cc1 -std=c++20 %s -triple %itanium_abi_triple -emit-llvm -o - | FileCheck %s |
| 2 |
|
| 3 |
module; |
| 4 |
# 5 __FILE__ 1 |
| 5 |
class Pooh; |
| 6 |
class Piglet; |
| 7 |
# 8 "" 2 |
| 8 |
|
| 9 |
# 8 "" 1 3 |
| 10 |
export module std; // might happen, you can't say it won't! |
| 11 |
# 9 "" 2 3 |
| 12 |
|
| 13 |
namespace std { |
| 14 |
export template<typename T> class allocator { |
| 15 |
// just for testing, not real! |
| 16 |
void M (T *); |
| 17 |
template <typename U> U *N (T *); |
| 18 |
}; |
| 19 |
|
| 20 |
template<typename T> void allocator<T>::M (T *) {} |
| 21 |
template<typename T> template<typename U> U *allocator<T>::N (T *) { |
| 22 |
return nullptr; |
| 23 |
} |
| 24 |
|
| 25 |
// CHECK-DAG: void @_ZNStW3std9allocatorIiE1MEPi( |
| 26 |
template void allocator<int>::M (int *); |
| 27 |
// CHECK-DAG: @_ZNStW3std9allocatorIiE1NIfEEPT_Pi( |
| 28 |
template float *allocator<int>::N<float> (int *); |
| 29 |
} |
| 30 |
|
| 31 |
// CHECK-DAG: @_ZNStW3std9allocatorI4PoohE1MEPS1_( |
| 32 |
template void std::allocator<Pooh>::M (Pooh *); |
| 33 |
// CHECK-DAG: @_ZNStW3std9allocatorI4PoohE1NI6PigletEEPT_PS1_( |
| 34 |
template Piglet *std::allocator<Pooh>::N<Piglet> (Pooh *); |