2013-12-09 05:12:27 +08:00
|
|
|
// REQUIRES: x86-registered-target
|
2013-01-23 05:39:58 +08:00
|
|
|
// RUN: %clang_cc1 %s -triple i386-apple-darwin10 -verify -fasm-blocks
|
2011-09-30 09:13:51 +08:00
|
|
|
|
|
|
|
#define M __asm int 0x2c
|
|
|
|
#define M2 int
|
|
|
|
|
2013-01-23 02:18:22 +08:00
|
|
|
void t1(void) { M }
|
|
|
|
void t2(void) { __asm int 0x2c }
|
|
|
|
void t3(void) { __asm M2 0x2c }
|
|
|
|
void t4(void) { __asm mov eax, fs:[0x10] }
|
2011-09-30 09:13:51 +08:00
|
|
|
void t5() {
|
2013-01-23 02:18:22 +08:00
|
|
|
__asm {
|
2011-09-30 09:13:51 +08:00
|
|
|
int 0x2c ; } asm comments are fun! }{
|
|
|
|
}
|
2013-01-23 02:18:22 +08:00
|
|
|
__asm {}
|
2011-09-30 09:13:51 +08:00
|
|
|
}
|
|
|
|
int t6() {
|
2013-01-23 02:18:22 +08:00
|
|
|
__asm int 3 ; } comments for single-line asm
|
|
|
|
__asm {}
|
2011-09-30 09:13:51 +08:00
|
|
|
|
2013-01-23 02:18:22 +08:00
|
|
|
__asm int 4
|
2011-09-30 09:13:51 +08:00
|
|
|
return 10;
|
|
|
|
}
|
2012-08-25 05:42:51 +08:00
|
|
|
void t7() {
|
2013-01-23 02:18:22 +08:00
|
|
|
__asm {
|
2012-06-13 03:03:42 +08:00
|
|
|
push ebx
|
|
|
|
mov ebx, 0x07
|
|
|
|
pop ebx
|
|
|
|
}
|
|
|
|
}
|
2012-06-13 04:30:26 +08:00
|
|
|
void t8() {
|
2013-01-23 02:18:22 +08:00
|
|
|
__asm nop __asm nop __asm nop
|
2012-06-13 04:30:26 +08:00
|
|
|
}
|
|
|
|
void t9() {
|
2013-01-23 02:18:22 +08:00
|
|
|
__asm nop __asm nop ; __asm nop
|
2012-06-13 04:30:26 +08:00
|
|
|
}
|
2012-06-13 03:03:42 +08:00
|
|
|
int t_fail() { // expected-note {{to match this}}
|
2013-01-23 02:18:22 +08:00
|
|
|
__asm
|
|
|
|
__asm { // expected-error 3 {{expected}} expected-note {{to match this}}
|