mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-27 02:46:06 +00:00
18 lines
375 B
C++
18 lines
375 B
C++
// Make sure foo is instantiated and we don't get a link error
|
|
// RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple %s -o- | FileCheck %s
|
|
|
|
template <typename T>
|
|
constexpr T foo(T a);
|
|
|
|
// CHECK-LABEL: define {{.*}} @main
|
|
int main() {
|
|
// CHECK: call {{.*}} @_Z3fooIiET_S0_
|
|
int k = foo<int>(5);
|
|
}
|
|
// CHECK: }
|
|
|
|
template <typename T>
|
|
constexpr T foo(T a) {
|
|
return a;
|
|
}
|