diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-05-12 15:22:40 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-05-12 15:22:40 +0000 |
commit | 20e95c5eb400c864bbd4421624fdf7b25ce70f56 (patch) | |
tree | 859ebafed0d49ef8ad26747c071f5cc201764a74 | |
parent | 264e93799c891c03d60cf0b09a032b0a9935d3b5 (diff) |
x86-64 ABI: clang incorrectly passes union { long double, float } in
register.
- Merge algorithm was returning MEMORY as it should.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71556 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/CGCall.cpp | 3 | ||||
-rw-r--r-- | test/CodeGen/x86_64-arguments.c | 3 |
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/CodeGen/CGCall.cpp b/lib/CodeGen/CGCall.cpp index c46e7901d9..a142729343 100644 --- a/lib/CodeGen/CGCall.cpp +++ b/lib/CodeGen/CGCall.cpp @@ -633,7 +633,8 @@ X86_64ABIInfo::Class X86_64ABIInfo::merge(Class Accum, return Field; else if (Accum == Integer || Field == Integer) return Integer; - else if (Field == X87 || Field == X87Up || Field == ComplexX87) + else if (Field == X87 || Field == X87Up || Field == ComplexX87 || + Accum == X87 || Accum == X87Up) return Memory; else return SSE; diff --git a/test/CodeGen/x86_64-arguments.c b/test/CodeGen/x86_64-arguments.c index fa73f7de67..2e5debe7cb 100644 --- a/test/CodeGen/x86_64-arguments.c +++ b/test/CodeGen/x86_64-arguments.c @@ -52,4 +52,7 @@ struct s9 { int a; int b; int : 0; } f9(void) {} struct s10 { int a; int b; int : 0; }; void f10(struct s10 a0) {} +// RUN: grep 'define void @f11(.union.anon. noalias sret .agg.result)' %t && +union { long double a; float b; } f11() {} + // RUN: true |