diff options
author | dim <dim@FreeBSD.org> | 2013-04-08 18:45:10 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2013-04-08 18:45:10 +0000 |
commit | c72c57c9e9b69944e3e009cd5e209634839581d3 (patch) | |
tree | 4fc2f184c499d106f29a386c452b49e5197bf63d /test/CodeGen/x86_32-inline-asm.c | |
parent | 5b20025c30d23d521e12c1f33ec8fa6b821952cd (diff) | |
download | FreeBSD-src-c72c57c9e9b69944e3e009cd5e209634839581d3.zip FreeBSD-src-c72c57c9e9b69944e3e009cd5e209634839581d3.tar.gz |
Vendor import of clang trunk r178860:
http://llvm.org/svn/llvm-project/cfe/trunk@178860
Diffstat (limited to 'test/CodeGen/x86_32-inline-asm.c')
-rw-r--r-- | test/CodeGen/x86_32-inline-asm.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/CodeGen/x86_32-inline-asm.c b/test/CodeGen/x86_32-inline-asm.c new file mode 100644 index 0000000..473f78e --- /dev/null +++ b/test/CodeGen/x86_32-inline-asm.c @@ -0,0 +1,24 @@ +// RUN: %clang_cc1 -triple i386-apple-darwin9 -verify %s +// <rdar://problem/12415959> + +typedef unsigned int u_int32_t; +typedef u_int32_t uint32_t; + +typedef unsigned long long u_int64_t; +typedef u_int64_t uint64_t; + +int func1() { + // Error out if size is > 32-bits. + uint32_t msr = 0x8b; + uint64_t val = 0; + __asm__ volatile("wrmsr" + : + : "c" (msr), + "a" ((val & 0xFFFFFFFFUL)), // expected-error {{invalid input size for constraint 'a'}} + "d" (((val >> 32) & 0xFFFFFFFFUL))); + + // Don't error out if the size of the destination is <= 32 bits. + unsigned char data; + unsigned int port; + __asm__ volatile("outb %0, %w1" : : "a" (data), "Nd" (port)); // No error expected. +} |