Eli Friedman | 3fedbe1 | 2011-09-30 01:13:51 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 %s -verify -fms-extensions |
| 2 | |
| 3 | #define M __asm int 0x2c |
| 4 | #define M2 int |
| 5 | |
| 6 | void t1(void) { M } |
| 7 | void t2(void) { __asm int 0x2c } |
| 8 | void t3(void) { __asm M2 0x2c } |
| 9 | void* t4(void) { __asm mov eax, fs:[0x10] } |
| 10 | void t5() { |
| 11 | __asm { |
| 12 | int 0x2c ; } asm comments are fun! }{ |
| 13 | } |
| 14 | __asm {} |
| 15 | } |
| 16 | int t6() { |
| 17 | __asm int 3 ; } comments for single-line asm |
| 18 | __asm {} |
| 19 | |
| 20 | __asm int 4 |
| 21 | return 10; |
| 22 | } |
Chad Rosier | a01eddb | 2012-06-12 19:03:42 +0000 | [diff] [blame] | 23 | int t7() { |
| 24 | __asm { |
| 25 | push ebx |
| 26 | mov ebx, 0x07 |
| 27 | pop ebx |
| 28 | } |
| 29 | } |
Chad Rosier | b3b26bf | 2012-06-12 20:30:26 +0000 | [diff] [blame] | 30 | void t8() { |
| 31 | __asm nop __asm nop __asm nop |
| 32 | } |
| 33 | void t9() { |
| 34 | __asm nop __asm nop ; __asm nop |
| 35 | } |
Chad Rosier | a01eddb | 2012-06-12 19:03:42 +0000 | [diff] [blame] | 36 | int t_fail() { // expected-note {{to match this}} |
Eli Friedman | 3fedbe1 | 2011-09-30 01:13:51 +0000 | [diff] [blame] | 37 | __asm |
| 38 | __asm { // expected-error 3 {{expected}} expected-note {{to match this}} |