Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 %s -fsyntax-only -verify -fblocks |
Steve Naroff | 9eae576 | 2008-09-18 16:44:58 +0000 | [diff] [blame] | 2 | |
Daniel Dunbar | 23afaad | 2009-11-17 08:57:36 +0000 | [diff] [blame] | 3 | int printf(const char *, ...); |
Steve Naroff | 9eae576 | 2008-09-18 16:44:58 +0000 | [diff] [blame] | 4 | |
| 5 | int main(int argc, char **argv) { |
| 6 | __block void(*bobTheFunction)(void); |
| 7 | __block void(^bobTheBlock)(void); |
| 8 | |
| 9 | bobTheBlock = ^{;}; |
| 10 | |
| 11 | __block int JJJJ; |
| 12 | __attribute__((__blocks__(byref))) int III; |
| 13 | |
| 14 | int (^XXX)(void) = ^{ return III+JJJJ; }; |
| 15 | |
Fariborz Jahanian | dbf217a | 2010-03-06 01:58:53 +0000 | [diff] [blame] | 16 | // rdar 7671883 |
| 17 | __block char array[10] = {'a', 'b', 'c', 'd'}; |
| 18 | char (^ch)() = ^{ array[1] = 'X'; return array[5]; }; |
| 19 | ch(); |
| 20 | |
Steve Naroff | 9eae576 | 2008-09-18 16:44:58 +0000 | [diff] [blame] | 21 | return 0; |
| 22 | } |