xref: /minix3/external/bsd/llvm/dist/clang/test/Parser/ms-inline-asm.c (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
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 
t1(void)7 void t1(void) { M }
t2(void)8 void t2(void) { __asm int 0x2c }
t3(void)9 void t3(void) { __asm M2 0x2c }
t4(void)10 void t4(void) { __asm mov eax, fs:[0x10] }
t5()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 void t11() {
49   do { __asm mov eax, 0 __asm { __asm mov edx, 1 } } while(0);
50 }
51 void t12() {
52   __asm jmp label // expected-error {{use of undeclared label 'label'}}
53 }
54 int t_fail() { // expected-note {{to match this}}
55   __asm
56   __asm { // expected-error 2 {{expected}} expected-note {{to match this}}
57