1f4a2713aSLionel Sambuc // RUN: %clang_cc1 %s -fsyntax-only -pedantic -verify
2f4a2713aSLionel Sambuc 
foo()3f4a2713aSLionel Sambuc void foo() {
4f4a2713aSLionel Sambuc   return foo();
5f4a2713aSLionel Sambuc }
6f4a2713aSLionel Sambuc 
7f4a2713aSLionel Sambuc // PR6451 - C++ Jump checking
8f4a2713aSLionel Sambuc struct X {
9f4a2713aSLionel Sambuc   X();
10f4a2713aSLionel Sambuc };
11f4a2713aSLionel Sambuc 
test2()12f4a2713aSLionel Sambuc void test2() {
13*0a6a1f1dSLionel Sambuc   goto later;  // expected-error {{cannot jump}}
14f4a2713aSLionel Sambuc   X x;         // expected-note {{jump bypasses variable initialization}}
15f4a2713aSLionel Sambuc later:
16f4a2713aSLionel Sambuc   ;
17f4a2713aSLionel Sambuc }
18f4a2713aSLionel Sambuc 
19f4a2713aSLionel Sambuc namespace PR6536 {
20f4a2713aSLionel Sambuc   struct A {};
a()21f4a2713aSLionel Sambuc   void a() { goto out; A x; out: return; }
22f4a2713aSLionel Sambuc }
23*0a6a1f1dSLionel Sambuc 
test3()24*0a6a1f1dSLionel Sambuc void test3() {
25*0a6a1f1dSLionel Sambuc     __asm__ ("":"+r" (test3)); // expected-error{{invalid lvalue in asm output}}
26*0a6a1f1dSLionel Sambuc }
27*0a6a1f1dSLionel Sambuc 
28*0a6a1f1dSLionel Sambuc void test4();                // expected-note{{possible target for call}}
test4(int)29*0a6a1f1dSLionel Sambuc void test4(int) {            // expected-note{{possible target for call}}
30*0a6a1f1dSLionel Sambuc   // expected-error@+1{{overloaded function could not be resolved}}
31*0a6a1f1dSLionel Sambuc   __asm__ ("":"+r" (test4)); // expected-error{{invalid lvalue in asm output}}
32*0a6a1f1dSLionel Sambuc }
test5()33*0a6a1f1dSLionel Sambuc void test5() {
34*0a6a1f1dSLionel Sambuc   char buf[1];
35*0a6a1f1dSLionel Sambuc   __asm__ ("":"+r" (buf));
36*0a6a1f1dSLionel Sambuc }
37*0a6a1f1dSLionel Sambuc 
38*0a6a1f1dSLionel Sambuc struct MMX_t {};
test6()39*0a6a1f1dSLionel Sambuc void test6() { __asm__("" : "=m"(*(MMX_t *)0)); }
40