blob: 653f16d263093c92def796e745279ebdaf83631c [file] [log] [blame]
Douglas Gregor73722482011-11-28 16:30:08 +00001// RUN: %clang_cc1 %s -emit-llvm -o - -triple=i686-apple-darwin9 | FileCheck %s
2
3namespace PR11411 {
4 template<typename _Tp> struct Ptr {
5 void f();
6 };
7
Stephen Lin43622612013-08-15 06:47:53 +00008 // CHECK-LABEL: define linkonce_odr void @_ZN7PR114113PtrIiE1fEv
Douglas Gregor73722482011-11-28 16:30:08 +00009 // CHECK-NOT: ret
10 template<typename _Tp> inline void Ptr<_Tp>::f() {
11 int* _refcount;
12 // CHECK: atomicrmw add i32*
13 __sync_fetch_and_add(_refcount, 1);
14 // CHECK-NEXT: ret void
15 }
16 void f(Ptr<int> *a) { a->f(); }
17}