blob: dff19b4654b022027c0489a836cecfd6867f3399 [file] [log] [blame]
Renato Golin69bb7f62013-01-25 22:13:50 +00001// REQUIRES: disabled
Chad Rosierbce92052013-01-22 21:39:58 +00002// RUN: %clang_cc1 %s -triple i386-apple-darwin10 -verify -fasm-blocks
Eli Friedman3fedbe12011-09-30 01:13:51 +00003
4#define M __asm int 0x2c
5#define M2 int
6
Chad Rosierc666cf42013-01-22 18:18:22 +00007void t1(void) { M }
8void t2(void) { __asm int 0x2c }
9void t3(void) { __asm M2 0x2c }
10void t4(void) { __asm mov eax, fs:[0x10] }
Eli Friedman3fedbe12011-09-30 01:13:51 +000011void t5() {
Chad Rosierc666cf42013-01-22 18:18:22 +000012 __asm {
Eli Friedman3fedbe12011-09-30 01:13:51 +000013 int 0x2c ; } asm comments are fun! }{
14 }
Chad Rosierc666cf42013-01-22 18:18:22 +000015 __asm {}
Eli Friedman3fedbe12011-09-30 01:13:51 +000016}
17int t6() {
Chad Rosierc666cf42013-01-22 18:18:22 +000018 __asm int 3 ; } comments for single-line asm
19 __asm {}
Eli Friedman3fedbe12011-09-30 01:13:51 +000020
Chad Rosierc666cf42013-01-22 18:18:22 +000021 __asm int 4
Eli Friedman3fedbe12011-09-30 01:13:51 +000022 return 10;
23}
Chad Rosier56d7f232012-08-24 21:42:51 +000024void t7() {
Chad Rosierc666cf42013-01-22 18:18:22 +000025 __asm {
Chad Rosiera01eddb2012-06-12 19:03:42 +000026 push ebx
27 mov ebx, 0x07
28 pop ebx
29 }
30}
Chad Rosierb3b26bf2012-06-12 20:30:26 +000031void t8() {
Chad Rosierc666cf42013-01-22 18:18:22 +000032 __asm nop __asm nop __asm nop
Chad Rosierb3b26bf2012-06-12 20:30:26 +000033}
34void t9() {
Chad Rosierc666cf42013-01-22 18:18:22 +000035 __asm nop __asm nop ; __asm nop
Chad Rosierb3b26bf2012-06-12 20:30:26 +000036}
Chad Rosiera01eddb2012-06-12 19:03:42 +000037int t_fail() { // expected-note {{to match this}}
Chad Rosierc666cf42013-01-22 18:18:22 +000038 __asm
39 __asm { // expected-error 3 {{expected}} expected-note {{to match this}}