Fariborz Jahanian | 564360b | 2010-06-24 00:08:06 +0000 | [diff] [blame] | 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 | |
Fariborz Jahanian | 4904bf4 | 2012-06-26 16:06:38 +0000 | [diff] [blame] | 39 | // CHECK: define internal void @___ZN4ZoneC2Ev_block_invoke |
Fariborz Jahanian | 564360b | 2010-06-24 00:08:06 +0000 | [diff] [blame] | 40 | // CHECK: define internal void @___ZN4ZoneC2Ev_block_invoke_ |
Fariborz Jahanian | 4904bf4 | 2012-06-26 16:06:38 +0000 | [diff] [blame] | 41 | // CHECK: define internal void @___ZN4ZoneD2Ev_block_invoke |
Fariborz Jahanian | 564360b | 2010-06-24 00:08:06 +0000 | [diff] [blame] | 42 | // CHECK: define internal void @___ZN4ZoneD2Ev_block_invoke_ |
Fariborz Jahanian | 4904bf4 | 2012-06-26 16:06:38 +0000 | [diff] [blame] | 43 | // CHECK: define internal void @___ZN1XC1Ev_block_invoke |
Fariborz Jahanian | 564360b | 2010-06-24 00:08:06 +0000 | [diff] [blame] | 44 | // CHECK: define internal void @___ZN1XC1Ev_block_invoke_ |
Fariborz Jahanian | 4904bf4 | 2012-06-26 16:06:38 +0000 | [diff] [blame] | 45 | // CHECK: define internal void @___ZN1XC2Ev_block_invoke |
Fariborz Jahanian | 564360b | 2010-06-24 00:08:06 +0000 | [diff] [blame] | 46 | // CHECK: define internal void @___ZN1XC2Ev_block_invoke_ |
Fariborz Jahanian | 4904bf4 | 2012-06-26 16:06:38 +0000 | [diff] [blame] | 47 | // CHECK: define internal void @___ZN1XD2Ev_block_invoke |
Fariborz Jahanian | 564360b | 2010-06-24 00:08:06 +0000 | [diff] [blame] | 48 | // CHECK: define internal void @___ZN1XD2Ev_block_invoke_ |