Home | History | Annotate | Download | only in Parser
      1 // REQUIRES: x86-registered-target
      2 // RUN: %clang_cc1 %s -triple i386-apple-darwin10 -verify -fasm-blocks
      3 
      4 #define M __asm int 0x2c
      5 #define M2 int
      6 
      7 void t1(void) { M }
      8 void t2(void) { __asm int 0x2c }
      9 void t3(void) { __asm M2 0x2c }
     10 void t4(void) { __asm mov eax, fs:[0x10] }
     11 void t5() {
     12   __asm {
     13     int 0x2c ; } asm comments are fun! }{
     14   }
     15   __asm {}
     16 }
     17 int t6() {
     18   __asm int 3 ; } comments for single-line asm
     19   __asm {}
     20 
     21   __asm int 4
     22   return 10;
     23 }
     24 void t7() {
     25   __asm {
     26     push ebx
     27     mov ebx, 0x07
     28     pop ebx
     29   }
     30 }
     31 void t8() {
     32   __asm nop __asm nop __asm nop
     33 }
     34 void t9() {
     35   __asm nop __asm nop ; __asm nop
     36 }
     37 void t10() {
     38   __asm {
     39     mov eax, 0
     40     __asm {
     41       mov eax, 1
     42       {
     43         mov eax, 2
     44       }
     45     }
     46   }
     47 }
     48 int t_fail() { // expected-note {{to match this}}
     49   __asm
     50   __asm { // expected-error 3 {{expected}} expected-note {{to match this}}
     51