diff options
| author | Roman Divacky <rdivacky@FreeBSD.org> | 2010-05-04 20:51:19 +0000 |
|---|---|---|
| committer | Roman Divacky <rdivacky@FreeBSD.org> | 2010-05-04 20:51:19 +0000 |
| commit | be17651f5cd2e94922c1b732bc8589e180698193 (patch) | |
| tree | 938fcb7c80a0402925b5b00fa684a245ab0936a5 /test/CodeGenCXX/reference-in-blocks.cpp | |
| parent | 0883ccd9eac3b974df00e6548ee319a7dd3646f4 (diff) | |
Notes
Diffstat (limited to 'test/CodeGenCXX/reference-in-blocks.cpp')
| -rw-r--r-- | test/CodeGenCXX/reference-in-blocks.cpp | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/test/CodeGenCXX/reference-in-blocks.cpp b/test/CodeGenCXX/reference-in-blocks.cpp index c020bab0f778..388ec7c4bbca 100644 --- a/test/CodeGenCXX/reference-in-blocks.cpp +++ b/test/CodeGenCXX/reference-in-blocks.cpp @@ -9,6 +9,26 @@ T _i; T get() {return _i;}; }; +// rdar: // 7495203 +class A { + public: + A() : field(10), d1(3.14) {} + void F(); + void S() { + printf(" field = %d\n", field); + printf(" field = %f\n", d1); + } + int field; + double d1; +}; + +void A::F() + { + __block A &tlc = *this; + // crashed in code gen (radar 7495203) + ^{ tlc.S(); }(); + } + int main() { // works @@ -16,6 +36,8 @@ int main() { //crashes in godegen? void (^bl2)(range<int>& ) = ^(range<int>& i){printf("Hello Blocks %d\n", i.get()); }; + + A *a = new A; + a->F(); return 0; } - |
