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 
8   // CHECK-LABEL: define linkonce_odr void @_ZN7PR114113PtrIiE1fEv
9   // CHECK-NOT: ret
f()10   template<typename _Tp> inline void Ptr<_Tp>::f() {
11     int* _refcount;
12     // CHECK: atomicrmw add i32* {{.*}} seq_cst, align 4
13     __sync_fetch_and_add(_refcount, 1);
14     // CHECK-NEXT: ret void
15   }
f(Ptr<int> * a)16   void f(Ptr<int> *a) { a->f(); }
17 }
18 
19 namespace DelegatingParameter {
20   // Check that we're delegating the complete ctor to the base
21   // ctor, and that doesn't crash.
22   // CHECK-LABEL: define void @_ZN19DelegatingParameter1SC1EU7_AtomicNS_1ZE
23   // CHECK: call void @_ZN19DelegatingParameter1SC2EU7_AtomicNS_1ZE
24   struct Z { int z[100]; };
25   struct S { S(_Atomic Z); };
S(_Atomic Z)26   S::S(_Atomic Z) {}
27 }
28