From db6d5cb8924b95871660193a2fbb848ab9bcbc68 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 23 Apr 2010 17:27:29 +0000 Subject: 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 --- clang/test/CodeGen/asm.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'clang/test/CodeGen/asm.c') 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 +} -- cgit v1.2.3