noinline-template.cpp revision 5e31474b9c8348e8d0404264ae6a8775e34df6ac
1// RUN: %clang_cc1 %s  -emit-llvm -o - | FileCheck %s
2
3// This was a problem in Sema, but only shows up as noinline missing
4// in CodeGen.
5
6// CHECK: define linkonce_odr void @_ZN6VectorIiE13growStorageByEv(%struct.Vector* %this) noinline nounwind
7
8template <class Ty> struct Vector  {
9  void growStorageBy();
10};
11template <class T> __attribute__((noinline)) void Vector<T>::growStorageBy() {
12}
13void foo() {
14 Vector<int> strs;
15 strs.growStorageBy();
16}
17