From: Anders Carlsson Date: Sat, 24 Jan 2009 18:03:09 +0000 (+0000) Subject: Handle the 'e' constraint. Fixes PR3385 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=79bc64ceb2586246c74b2584be56ecef00a0c9c1;p=clang Handle the 'e' constraint. Fixes PR3385 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62923 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Basic/Targets.cpp b/lib/Basic/Targets.cpp index 4128946493..026641c7c7 100644 --- a/lib/Basic/Targets.cpp +++ b/lib/Basic/Targets.cpp @@ -505,8 +505,10 @@ X86TargetInfo::validateAsmConstraint(char c, case 'y': // Any MMX register. case 'x': // Any SSE register. case 'Q': // Any register accessible as [r]h: a, b, c, and d. - case 'Z': // 32-bit integer constant for use with zero-extending x86_64 - // instructions. + case 'e': // 32-bit signed integer constant for use with zero-extending + // x86_64 instructions. + case 'Z': // 32-bit unsigned integer constant for use with zero-extending + // x86_64 instructions. case 'N': // unsigned 8-bit integer constant for use with in and out // instructions. info = (TargetInfo::ConstraintInfo)(info|TargetInfo::CI_AllowsRegister); diff --git a/test/Sema/asm.c b/test/Sema/asm.c index 4093b1abeb..fa9b125b6d 100644 --- a/test/Sema/asm.c +++ b/test/Sema/asm.c @@ -54,3 +54,9 @@ void test5() { asm("nop" : : "X" (8)); } + +// PR3385 +void test6(long i) +{ + asm("nop" : : "er"(i)); +} \ No newline at end of file