Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 %s -verify -fblocks -fsyntax-only |
Steve Naroff | d8eb456 | 2009-03-13 16:03:38 +0000 | [diff] [blame] | 2 | |
Chris Lattner | e030358 | 2010-01-09 20:43:19 +0000 | [diff] [blame] | 3 | void xx(); |
| 4 | |
Steve Naroff | d8eb456 | 2009-03-13 16:03:38 +0000 | [diff] [blame] | 5 | int a() { |
Chris Lattner | 2fda14a | 2011-02-18 01:25:14 +0000 | [diff] [blame] | 6 | A: |
| 7 | |
| 8 | if (1) xx(); |
| 9 | return ^{ |
| 10 | A: return 1; |
| 11 | }(); |
Steve Naroff | d8eb456 | 2009-03-13 16:03:38 +0000 | [diff] [blame] | 12 | } |
| 13 | int b() { |
| 14 | A: return ^{int a; A:return 1;}(); |
| 15 | } |
| 16 | |
| 17 | int d() { |
| 18 | A: return ^{int a; A: a = ^{int a; A:return 1;}() + ^{int b; A:return 2;}(); return a; }(); |
| 19 | } |
| 20 | |
| 21 | int c() { |
Chris Lattner | 2fda14a | 2011-02-18 01:25:14 +0000 | [diff] [blame] | 22 | goto A; // expected-error {{use of undeclared label 'A'}} |
| 23 | return ^{ |
| 24 | A: |
| 25 | return 1; |
| 26 | }(); |
Steve Naroff | d8eb456 | 2009-03-13 16:03:38 +0000 | [diff] [blame] | 27 | } |