1 // RUN: %clang_cc1 -fsyntax-only -verify %s -fblocks
4 goto L1; // expected-error {{use of undeclared label 'L1'}}
6 #pragma clang __debug captured
11 goto L3; // expected-error {{use of undeclared label 'L3'}}
16 void test_break_continue() {
18 #pragma clang __debug captured
20 break; // expected-error {{'break' statement not in loop or switch statement}}
21 continue; // expected-error {{'continue' statement not in loop statement}}
28 #pragma clang __debug captured
30 return; // expected-error {{cannot return from default captured statement}}
37 #pragma clang __debug captured
40 #pragma clang __debug captured
43 #pragma clang __debug captured
51 void test_nest_block() {
52 __block int x; // expected-note {{'x' declared here}}
56 #pragma clang __debug captured
58 x = y; // expected-error{{__block variable 'x' cannot be captured in a captured statement}}
59 y = z; // expected-error{{variable is not assignable (missing __block type specifier)}}
64 __block int a; // expected-note 2 {{'a' declared here}}
66 #pragma clang __debug captured
71 a = b; // expected-error{{__block variable 'a' cannot be captured in a captured statement}}
72 b = d; // OK - Consistent with block inside a lambda
73 c = a; // expected-error{{__block variable 'a' cannot be captured in a captured statement}}
75 d = b; // expected-error{{variable is not assignable (missing __block type specifier)}}