Douglas Gregor | 7372248 | 2011-11-28 16:30:08 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 %s -emit-llvm -o - -triple=i686-apple-darwin9 | FileCheck %s |
| 2 | |
| 3 | namespace PR11411 { |
| 4 | template<typename _Tp> struct Ptr { |
| 5 | void f(); |
| 6 | }; |
| 7 | |
Stephen Lin | 4362261 | 2013-08-15 06:47:53 +0000 | [diff] [blame] | 8 | // CHECK-LABEL: define linkonce_odr void @_ZN7PR114113PtrIiE1fEv |
Douglas Gregor | 7372248 | 2011-11-28 16:30:08 +0000 | [diff] [blame] | 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 | } |