llvm/clang/test/Driver/ppc-inlineasm-sf.c
Strahinja Petrovic 4f839ac188 [PowerPC] Fix issue with inline asm - soft float mode
This patch prevents floating point register
constraints in soft float mode.

Differential Revision: https://reviews.llvm.org/D59310

llvm-svn: 357466
2019-04-02 11:00:09 +00:00

17 lines
695 B
C

// RUN: not %clang -target powerpc-unknown-linux -O2 -fPIC -m32 -msoft-float %s -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-ERRMSG %s
int foo ()
{
double x,y;
int a;
__asm__ ("fctiw %0,%1" : "=f"(x) : "f"(y));
// CHECK-ERRMSG: error: invalid output constraint '=f' in asm
// CHECK-ERRMSG-NEXT: __asm__ ("fctiw %0,%1" : "=f"(x) : "f"(y));
__asm__ ("fctiw %0,%1" : "=d"(x) : "d"(y));
// CHECK-ERRMSG: error: invalid output constraint '=d' in asm
// CHECK-ERRMSG-NEXT: __asm__ ("fctiw %0,%1" : "=d"(x) : "d"(y));
__asm__ ("vec_dss %0" : "=v"(a));
// CHECK-ERRMSG: error: invalid output constraint '=v' in asm
// CHECK-ERRMSG-NEXT: __asm__ ("vec_dss %0" : "=v"(a));
}