Home | History | Annotate | Download | only in Sema
      1 // RUN: %clang_cc1 -verify %s
      2 
      3 void f();
      4 void f() __asm__("fish");
      5 void g();
      6 
      7 void f() {
      8   g();
      9 }
     10 void g() __asm__("gold");  // expected-error{{cannot apply asm label to function after its first use}}
     11 
     12 void h() __asm__("hose");  // expected-note{{previous declaration is here}}
     13 void h() __asm__("hair");  // expected-error{{conflicting asm label}}
     14 
     15 int x;
     16 int x __asm__("xenon");
     17 int y;
     18 
     19 int test() { return y; }
     20 
     21 int y __asm__("yacht");  // expected-error{{cannot apply asm label to variable after its first use}}
     22 
     23 int z __asm__("zebra");  // expected-note{{previous declaration is here}}
     24 int z __asm__("zooms");  // expected-error{{conflicting asm label}}
     25 
     26 
     27 // No diagnostics on the following.
     28 void __real_readlink() __asm("readlink");
     29 void readlink() __asm("__protected_readlink");
     30 void readlink() { __real_readlink(); }
     31