diff options
| author | Bill Wendling <isanbard@gmail.com> | 2012-11-12 06:42:51 +0000 |
|---|---|---|
| committer | Bill Wendling <isanbard@gmail.com> | 2012-11-12 06:42:51 +0000 |
| commit | 887b485dbe3dec6fb0387cf80c0e79f02bc7201d (patch) | |
| tree | 22715c6291ab527da45b3e75c149743551bccf20 /clang/test/CodeGen | |
| parent | b41000ed70a0699215399f8b17bf2d9526e74c56 (diff) | |
| download | bcm5719-llvm-887b485dbe3dec6fb0387cf80c0e79f02bc7201d.tar.gz bcm5719-llvm-887b485dbe3dec6fb0387cf80c0e79f02bc7201d.zip | |
Check that the input size is correct for the given constraint.
The 'a', 'c', and 'd' constraints on i386 mean a 32-bit register. We cannot
place a 64-bit value into the 32-bit register. Error out instead of causing the
compiler to spew general badness.
<rdar://problem/12415959>
llvm-svn: 167717
Diffstat (limited to 'clang/test/CodeGen')
| -rw-r--r-- | clang/test/CodeGen/x86_32-inline-asm.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/clang/test/CodeGen/x86_32-inline-asm.c b/clang/test/CodeGen/x86_32-inline-asm.c new file mode 100644 index 00000000000..0596ba4307c --- /dev/null +++ b/clang/test/CodeGen/x86_32-inline-asm.c @@ -0,0 +1,18 @@ +// 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 main () { + 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))); +} |

