blob: 15b0b50ddc75240c3158c4e6f35edc0fbac8b5f6 [file] [log] [blame]
Chris Lattner6d97e5e2010-03-01 20:59:53 +00001// RUN: %clang_cc1 %s -fsyntax-only -pedantic -verify
Chris Lattnere878eb02008-12-18 02:03:48 +00002
3void foo() {
4 return foo();
5}
Chris Lattner6d97e5e2010-03-01 20:59:53 +00006
7// PR6451 - C++ Jump checking
8struct X {
9 X();
10};
11
12void test2() {
Stephen Hines176edba2014-12-01 14:53:08 -080013 goto later; // expected-error {{cannot jump}}
Chris Lattner6d97e5e2010-03-01 20:59:53 +000014 X x; // expected-note {{jump bypasses variable initialization}}
15later:
16 ;
17}
Douglas Gregor516a6bc2010-03-08 02:45:10 +000018
19namespace PR6536 {
20 struct A {};
21 void a() { goto out; A x; out: return; }
22}
Stephen Hines0e2c34f2015-03-23 12:09:02 -070023
24void test3() {
25 __asm__ ("":"+r" (test3)); // expected-error{{invalid lvalue in asm output}}
26}
27
28void test4(); // expected-note{{possible target for call}}
29void test4(int) { // expected-note{{possible target for call}}
30 // expected-error@+1{{overloaded function could not be resolved}}
31 __asm__ ("":"+r" (test4)); // expected-error{{invalid lvalue in asm output}}
32}
33void test5() {
34 char buf[1];
35 __asm__ ("":"+r" (buf));
36}
37
38struct MMX_t {};
39void test6() { __asm__("" : "=m"(*(MMX_t *)0)); }