2012-12-05 21:08:21 +00:00
|
|
|
// RUN: %clang_cc1 %s -verify -fasm-blocks
|
2011-09-30 01:13:51 +00:00
|
|
|
|
|
|
|
#define M __asm int 0x2c
|
|
|
|
#define M2 int
|
|
|
|
|
2012-06-20 18:28:37 +00:00
|
|
|
void t1(void) { M } // expected-warning {{MS-style inline assembly is not supported}}
|
|
|
|
void t2(void) { __asm int 0x2c } // expected-warning {{MS-style inline assembly is not supported}}
|
|
|
|
void t3(void) { __asm M2 0x2c } // expected-warning {{MS-style inline assembly is not supported}}
|
2012-08-24 21:42:51 +00:00
|
|
|
void t4(void) { __asm mov eax, fs:[0x10] } // expected-warning {{MS-style inline assembly is not supported}}
|
2011-09-30 01:13:51 +00:00
|
|
|
void t5() {
|
2012-06-20 18:28:37 +00:00
|
|
|
__asm { // expected-warning {{MS-style inline assembly is not supported}}
|
2011-09-30 01:13:51 +00:00
|
|
|
int 0x2c ; } asm comments are fun! }{
|
|
|
|
}
|
2012-08-14 19:22:06 +00:00
|
|
|
__asm {} // expected-warning {{MS-style inline assembly is not supported}}
|
2011-09-30 01:13:51 +00:00
|
|
|
}
|
|
|
|
int t6() {
|
2012-06-20 18:28:37 +00:00
|
|
|
__asm int 3 ; } comments for single-line asm // expected-warning {{MS-style inline assembly is not supported}}
|
2012-08-14 19:22:06 +00:00
|
|
|
__asm {} // expected-warning {{MS-style inline assembly is not supported}}
|
2011-09-30 01:13:51 +00:00
|
|
|
|
2012-08-14 19:22:06 +00:00
|
|
|
__asm int 4 // expected-warning {{MS-style inline assembly is not supported}}
|
2011-09-30 01:13:51 +00:00
|
|
|
return 10;
|
|
|
|
}
|
2012-08-24 21:42:51 +00:00
|
|
|
void t7() {
|
2012-06-20 18:28:37 +00:00
|
|
|
__asm { // expected-warning {{MS-style inline assembly is not supported}}
|
2012-06-12 19:03:42 +00:00
|
|
|
push ebx
|
|
|
|
mov ebx, 0x07
|
|
|
|
pop ebx
|
|
|
|
}
|
|
|
|
}
|
2012-06-12 20:30:26 +00:00
|
|
|
void t8() {
|
2012-08-15 21:03:27 +00:00
|
|
|
__asm nop __asm nop __asm nop // expected-warning {{MS-style inline assembly is not supported}}
|
2012-06-12 20:30:26 +00:00
|
|
|
}
|
|
|
|
void t9() {
|
2012-08-15 21:03:27 +00:00
|
|
|
__asm nop __asm nop ; __asm nop // expected-warning {{MS-style inline assembly is not supported}}
|
2012-06-12 20:30:26 +00:00
|
|
|
}
|
2012-06-12 19:03:42 +00:00
|
|
|
int t_fail() { // expected-note {{to match this}}
|
2012-08-24 21:42:51 +00:00
|
|
|
__asm // expected-warning {{MS-style inline assembly is not supported}}
|
|
|
|
__asm { // expected-warning {{MS-style inline assembly is not supported}} expected-error 3 {{expected}} expected-note {{to match this}}
|