blob: 6b830d9fa7a92cc183d771044f7fbaf45d031645 [file] [log] [blame]
Denis Zobnin628b0222016-04-21 10:59:18 +00001// 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 Golin1f042132016-04-21 14:40:06 +00003// REQUIRES: x86-registered-target
Denis Zobnin628b0222016-04-21 10:59:18 +00004
5void 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}