1 // RUN: %clang_cc1 %s -triple i386-pc-linux-gnu -verify -fsyntax-only
2 // RUN: %clang_cc1 %s -triple x86_64-pc-linux-gnu -verify -fsyntax-only
11 // expected-error@+1 {{cannot jump from this goto statement to its label}}
13 // expected-note@+1 {{jump bypasses variable with a non-trivial destructor}}
17 // expected-error@+1 {{cannot jump from this asm goto statement to one of its possible targets}}
18 asm goto("jmp %l0;" ::::Later
);
19 // expected-note@+1 {{jump bypasses variable with a non-trivial destructor}}
21 // expected-note@+1 {{possible target of asm goto statement}}
30 // expected-note@+2 {{jump exits scope of variable with non-trivial destructor}}
31 // expected-note@+1 {{jump exits scope of variable with non-trivial destructor}}
34 // expected-error@+1 {{cannot jump from this asm goto statement to one of its possible targets}}
35 asm goto("jmp %l0;" ::::BAR
);
36 // expected-error@+1 {{cannot jump from this indirect goto statement to one of its possible targets}}
42 // expected-note@+2 {{possible target of asm goto statement}}
43 // expected-note@+1 {{possible target of indirect goto statement}}
50 // expected-error@+2 {{cannot jump from this asm goto statement to one of its possible targets}}
51 // expected-error@+1 {{cannot jump from this asm goto statement to one of its possible targets}}
52 asm volatile goto("testl %0, %0; jne %l1;" :: "r"(n
)::label_true
, loop
);
53 // expected-note@+3 {{jump bypasses initialization of variable length array}}
54 // expected-note@+2 {{possible target of asm goto statement}}
55 // expected-note@+1 {{jump enters a statement expression}}
56 return ({int a
[n
];label_true
: 2;});
57 // expected-note@+1 {{jump bypasses initialization of variable length array}}
59 // expected-note@+1 {{possible target of asm goto statement}}
64 void test4cleanup(int*);
65 // No errors expected.
69 int x
__attribute__((cleanup(test4cleanup
)));
74 void statement_expressions() {
77 asm goto("" : : : : label
);
83 asm goto("" : : : : label
);