http://llvm.org/bugs/show_bug.cgi?id=20278

            Bug ID: 20278
           Summary: MS ABI: fastcall methods with struct return are broken
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: LLVM Codegen
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

We have two register parameters and we are failing to account for the fact that
the sret parameter consumes one register slot.

This program fails to link and run together with MSVC:
struct SRet {
  int x;
  SRet(int x) : x(x) {}
};
struct A {
  virtual SRet __fastcall f(int);
};
#ifdef CONFIG_1
SRet A::f(int x) {
  return SRet(x);
}
#else
int main() {
  A a;
  SRet x = a.f(42);
  return x.x;
}
#endif

It should exit 42.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to