brintos

brintos / llvm-project-archived public Read only

0
0
Text · 839 B · fb584c1 Raw
28 lines · cpp
1// RUN: %clang_cc1 %s -emit-llvm -o - -triple=i686-apple-darwin9 | FileCheck %s2 3namespace PR11411 {4  template<typename _Tp> struct Ptr {5    void f();6  };7 8  // CHECK-LABEL: define linkonce_odr void @_ZN7PR114113PtrIiE1fEv9  // CHECK-NOT: ret10  template<typename _Tp> inline void Ptr<_Tp>::f() {11    int* _refcount;12    // CHECK: atomicrmw add ptr {{.*}} seq_cst, align 413    __sync_fetch_and_add(_refcount, 1);14    // CHECK-NEXT: ret void15  }16  void f(Ptr<int> *a) { a->f(); }17}18 19namespace DelegatingParameter {20  // Check that we're delegating the complete ctor to the base21  // ctor, and that doesn't crash.22  // CHECK-LABEL: define void @_ZN19DelegatingParameter1SC1EU7_AtomicNS_1ZE23  // CHECK: call void @_ZN19DelegatingParameter1SC2EU7_AtomicNS_1ZE24  struct Z { int z[100]; };25  struct S { S(_Atomic Z); };26  S::S(_Atomic Z) {}27}28