Home | History | Annotate | Download | only in CodeGenCXX
      1 // RUN: %clang_cc1 %s -fblocks -triple x86_64-apple-darwin -emit-llvm -o - | FileCheck %s
      2 
      3 typedef void (^dispatch_block_t)(void);
      4 
      5 void dispatch_once(dispatch_block_t);
      6 
      7 class Zone {
      8 public:
      9   Zone();
     10   ~Zone();
     11 };
     12 
     13 Zone::Zone() {
     14     dispatch_once(^{});
     15     dispatch_once(^{});
     16 }
     17 
     18 Zone::~Zone() {
     19     dispatch_once(^{});
     20     dispatch_once(^{});
     21 }
     22 
     23 class X : public virtual Zone {
     24   X();
     25   ~X();
     26 };
     27 
     28 X::X() {
     29     dispatch_once(^{});
     30     dispatch_once(^{});
     31 };
     32 
     33 X::~X() {
     34     dispatch_once(^{});
     35     dispatch_once(^{});
     36 };
     37 
     38 
     39 // CHECK-LABEL: define internal void @___ZN4ZoneC2Ev_block_invoke
     40 // CHECK-LABEL: define internal void @___ZN4ZoneC2Ev_block_invoke_
     41 // CHECK-LABEL: define internal void @___ZN4ZoneD2Ev_block_invoke
     42 // CHECK-LABEL: define internal void @___ZN4ZoneD2Ev_block_invoke_
     43 // CHECK-LABEL: define internal void @___ZN1XC2Ev_block_invoke
     44 // CHECK-LABEL: define internal void @___ZN1XC2Ev_block_invoke_
     45 // CHECK-LABEL: define internal void @___ZN1XC1Ev_block_invoke
     46 // CHECK-LABEL: define internal void @___ZN1XC1Ev_block_invoke_
     47 // CHECK-LABEL: define internal void @___ZN1XD2Ev_block_invoke
     48 // CHECK-LABEL: define internal void @___ZN1XD2Ev_block_invoke_
     49