Home | History | Annotate | Download | only in Parser
      1 // RUN: %clang_cc1 -fsyntax-only -verify %s
      2 
      3 void f1() {
      4   // PR7673: Some versions of GCC support an empty clobbers section.
      5   asm ("ret" : : :);
      6 }
      7 
      8 void f2() {
      9   asm("foo" : "=r" (a)); // expected-error {{use of undeclared identifier 'a'}}
     10   asm("foo" : : "r" (b)); // expected-error {{use of undeclared identifier 'b'}}
     11 
     12   asm const (""); // expected-warning {{ignored const qualifier on asm}}
     13   asm volatile ("");
     14   asm restrict (""); // expected-warning {{ignored restrict qualifier on asm}}
     15   // FIXME: Once GCC supports _Atomic, check whether it allows this.
     16   asm _Atomic (""); // expected-warning {{ignored _Atomic qualifier on asm}}
     17 }
     18 
     19 
     20 // rdar://5952468
     21 __asm ; // expected-error {{expected '(' after 'asm'}}
     22 
     23 // <rdar://problem/10465079> - Don't crash on wide string literals in 'asm'.
     24 int foo asm (L"bar"); // expected-error {{cannot use wide string literal in 'asm'}}
     25 
     26