xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGenCXX/noinline-template.cpp (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 %s -emit-llvm -triple %itanium_abi_triple -o - | FileCheck %s
2f4a2713aSLionel Sambuc 
3f4a2713aSLionel Sambuc // This was a problem in Sema, but only shows up as noinline missing
4f4a2713aSLionel Sambuc // in CodeGen.
5f4a2713aSLionel Sambuc 
6*0a6a1f1dSLionel Sambuc // CHECK: define linkonce_odr {{.*}}void @_ZN6VectorIiE13growStorageByEv(%struct.Vector* %this) [[NI:#[0-9]+]]
7f4a2713aSLionel Sambuc 
8f4a2713aSLionel Sambuc template <class Ty> struct Vector  {
9f4a2713aSLionel Sambuc   void growStorageBy();
10f4a2713aSLionel Sambuc };
growStorageBy()11f4a2713aSLionel Sambuc template <class T> __attribute__((noinline)) void Vector<T>::growStorageBy() {
12f4a2713aSLionel Sambuc }
foo()13f4a2713aSLionel Sambuc void foo() {
14f4a2713aSLionel Sambuc  Vector<int> strs;
15f4a2713aSLionel Sambuc  strs.growStorageBy();
16f4a2713aSLionel Sambuc }
17f4a2713aSLionel Sambuc 
18f4a2713aSLionel Sambuc // CHECK: attributes [[NI]] = { noinline nounwind{{.*}} }
19