blob: d1b60cc7d31f13e3b40299eb34503b221945c7c7 [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 %s -verify -fblocks -fsyntax-only
Steve Naroffd8eb4562009-03-13 16:03:38 +00002
Chris Lattnere0303582010-01-09 20:43:19 +00003void xx();
4
Steve Naroffd8eb4562009-03-13 16:03:38 +00005int a() {
Chris Lattner2fda14a2011-02-18 01:25:14 +00006 A:
7
8 if (1) xx();
9 return ^{
10 A: return 1;
11 }();
Steve Naroffd8eb4562009-03-13 16:03:38 +000012}
13int b() {
14 A: return ^{int a; A:return 1;}();
15}
16
17int d() {
18 A: return ^{int a; A: a = ^{int a; A:return 1;}() + ^{int b; A:return 2;}(); return a; }();
19}
20
21int c() {
Chris Lattner2fda14a2011-02-18 01:25:14 +000022 goto A; // expected-error {{use of undeclared label 'A'}}
23 return ^{
24 A:
25 return 1;
26 }();
Steve Naroffd8eb4562009-03-13 16:03:38 +000027}