diff options
author | Chris Lattner <sabre@nondot.org> | 2010-04-23 17:27:29 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-04-23 17:27:29 +0000 |
commit | db6d5cb8924b95871660193a2fbb848ab9bcbc68 (patch) | |
tree | d8a116d8d4b946fb4752331f926110194ad04e38 /clang/test/CodeGen/asm.c | |
parent | e459686aac87fd16a64d9f13dc6a2a07dc799e41 (diff) | |
download | bcm5719-llvm-db6d5cb8924b95871660193a2fbb848ab9bcbc68.tar.gz bcm5719-llvm-db6d5cb8924b95871660193a2fbb848ab9bcbc68.zip |
Implement PR6845. We allow matching constraints to have different
input and output types when the smaller value isn't mentioned in the
asm string. Extend this support from integers to also allowing
fp values to be mismatched (if not mentioned in the asm string).
llvm-svn: 102188
Diffstat (limited to 'clang/test/CodeGen/asm.c')
-rw-r--r-- | clang/test/CodeGen/asm.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/clang/test/CodeGen/asm.c b/clang/test/CodeGen/asm.c index ace0db9af6d..50770288786 100644 --- a/clang/test/CodeGen/asm.c +++ b/clang/test/CodeGen/asm.c @@ -147,3 +147,24 @@ int t19(unsigned data) { // CHECK: = call {{.*}}asm "x$(abc$|def$|ghi$)z" } + +// PR6845 - Mismatching source/dest fp types. +double t20(double x) { + register long double result; + __asm __volatile ("frndint" : "=t" (result) : "0" (x)); + return result; + + // CHECK: @t20 + // CHECK: fpext double {{.*}} to x86_fp80 + // CHECK-NEXT: call x86_fp80 asm sideeffect "frndint" + // CHECK: fptrunc x86_fp80 {{.*}} to double +} + +float t21(long double x) { + register float result; + __asm __volatile ("frndint" : "=t" (result) : "0" (x)); + return result; + // CHECK: @t21 + // CHECK: call x86_fp80 asm sideeffect "frndint" + // CHECK-NEXT: fptrunc x86_fp80 {{.*}} to float +} |