Hans Wennborg | 442e4f7 | 2013-12-13 22:43:52 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 %s -cxx-abi itanium -emit-llvm -o - -fblocks |
| 2 | // RUN: %clang_cc1 %s -cxx-abi microsoft -fno-rtti -emit-llvm -o - -fblocks |
David Chisnall | 5221a94 | 2012-04-04 13:07:13 +0000 | [diff] [blame] | 3 | // Just test that this doesn't crash the compiler... |
| 4 | |
| 5 | void func(void*); |
| 6 | |
| 7 | struct Test |
| 8 | { |
| 9 | virtual void use() { func((void*)this); } |
| 10 | Test(Test&c) { func((void*)this); } |
| 11 | Test() { func((void*)this); } |
| 12 | }; |
| 13 | |
| 14 | void useBlock(void (^)(void)); |
| 15 | |
| 16 | int main (void) { |
| 17 | __block Test t; |
| 18 | useBlock(^(void) { t.use(); }); |
| 19 | } |
| 20 | |