Denis Zobnin | 628b022 | 2016-04-21 10:59:18 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -triple i386-unknown-unknown -fasm-blocks -fsyntax-only -verify %s -DCHECK_ASM_GOTO |
| 2 | // RUN: %clang_cc1 -triple i386-unknown-unknown -fasm-blocks -O0 -emit-llvm -S %s -o - | FileCheck %s |
Renato Golin | 1f04213 | 2016-04-21 14:40:06 +0000 | [diff] [blame] | 3 | // REQUIRES: x86-registered-target |
Denis Zobnin | 628b022 | 2016-04-21 10:59:18 +0000 | [diff] [blame] | 4 | |
| 5 | void f() { |
| 6 | __asm mov eax, ebx |
| 7 | __asm mov ebx, ecx |
| 8 | __asm__("movl %ecx, %edx"); |
| 9 | // CHECK: movl %ebx, %eax |
| 10 | // CHECK: movl %ecx, %ebx |
| 11 | // CHECK: movl %ecx, %edx |
| 12 | |
| 13 | __asm mov eax, ebx |
| 14 | __asm volatile ("movl %ecx, %edx"); |
| 15 | // CHECK: movl %ebx, %eax |
| 16 | // CHECK: movl %ecx, %edx |
| 17 | |
| 18 | __asm mov eax, ebx |
| 19 | __asm const ("movl %ecx, %edx"); // expected-warning {{ignored const qualifier on asm}} |
| 20 | // CHECK: movl %ebx, %eax |
| 21 | // CHECK: movl %ecx, %edx |
| 22 | |
| 23 | #ifdef CHECK_ASM_GOTO |
| 24 | __asm volatile goto ("movl %ecx, %edx"); // expected-error {{'asm goto' constructs are not supported yet}} |
| 25 | |
| 26 | __asm mov eax, ebx |
| 27 | __asm goto ("movl %ecx, %edx"); // expected-error {{'asm goto' constructs are not supported yet}} |
| 28 | #endif |
| 29 | } |