2 // The LLVM Compiler Infrastructure
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
25 TestObject(CONST TestObject& inObj);
29 TestObject& operator=(CONST TestObject& inObj);
33 int version() CONST { return _version; }
38 TestObject::TestObject(CONST TestObject& inObj)
42 _version = inObj._version;
43 //printf("%p (%d) -- TestObject(const TestObject&) called", this, _version);
47 TestObject::TestObject()
49 _version = ++constructors;
50 //printf("%p (%d) -- TestObject() called\n", this, _version);
54 TestObject::~TestObject()
56 //printf("%p -- ~TestObject() called\n", this);
61 TestObject& TestObject::operator=(CONST TestObject& inObj)
63 //printf("%p -- operator= called", this);
64 _version = inObj._version;
69 void TestObject::test(void) {
70 void (^b)(void) = ^{ recovered = _version; };
71 void (^b2)(void) = Block_copy(b);
87 int main(int argc, char *argv[]) {
90 printf("%s: success\n", argv[0]);
93 printf("%s: *** didn't recover byref block variable\n", argv[0]);