blob: 36bb4ef5608e5c488ffc06bbf1d95a967061c3cb [file] [log] [blame]
Douglas Gregora9766412011-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
8 // CHECK: define linkonce_odr void @_ZN7PR114113PtrIiE1fEv
9 // 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}