aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-05-08 20:55:49 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-05-08 20:55:49 +0000
commiteedd292ea0cf2216ff16d3490147323489102e3a (patch)
tree475e459bc55a9c5d9c634ce6c951980d7af69bc5
parentf7fff322debe0b7256fe4dbc1103a3c2b43c379a (diff)
Darwin x86_32: Improve bit-field handling for returning records.
- This turns out to be a no-op now that most of the handling for everything else is in place. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71261 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/CGCall.cpp4
-rw-r--r--test/CodeGen/x86_32-arguments.c21
2 files changed, 11 insertions, 14 deletions
diff --git a/lib/CodeGen/CGCall.cpp b/lib/CodeGen/CGCall.cpp
index e9f2bba303..eba5ff5b5e 100644
--- a/lib/CodeGen/CGCall.cpp
+++ b/lib/CodeGen/CGCall.cpp
@@ -342,10 +342,6 @@ bool X86_32ABIInfo::shouldReturnTypeInRegister(QualType Ty,
e = RT->getDecl()->field_end(Context); i != e; ++i) {
const FieldDecl *FD = *i;
- // FIXME: Reject bit-fields wholesale for now; this is incorrect.
- if (FD->isBitField())
- return false;
-
// Empty structures are ignored.
if (isEmptyRecord(Context, FD->getType()))
continue;
diff --git a/test/CodeGen/x86_32-arguments.c b/test/CodeGen/x86_32-arguments.c
index 14144c438c..b18d2d0acb 100644
--- a/test/CodeGen/x86_32-arguments.c
+++ b/test/CodeGen/x86_32-arguments.c
@@ -47,12 +47,10 @@ void f8_2(struct s8 a0) {
// This should be passed just as s8.
-// FIXME: This is wrong, but we want the coverage of the other
-// tests. This should be the same as @f8_1.
-// RUN: grep 'define void @f9_1(%.truct.s9\* noalias sret %agg.result)' %t &&
+// RUN: grep 'define i64 @f9_1()' %t &&
-// FIXME: This is wrong, but we want the coverage of the other
-// tests. This should be the same as @f8_2.
+// FIXME: llvm-gcc expands this, this may have some value for the
+// backend in terms of optimization but doesn't change the ABI.
// RUN: grep 'define void @f9_2(%.truct.s9\* byval %a0)' %t &&
struct s9 {
int a : 17;
@@ -96,11 +94,11 @@ T16 f16(void) {}
// 128-bits).
// RUN: grep 'i32 @f17()' %t &&
-// RUN: grep -F 'void @f18(%3* noalias sret %agg.result)' %t &&
-// RUN: grep -F 'void @f19(%4* noalias sret %agg.result)' %t &&
-// RUN: grep -F 'void @f20(%5* noalias sret %agg.result)' %t &&
-// RUN: grep -F 'void @f21(%6* noalias sret %agg.result)' %t &&
-// RUN: grep -F 'void @f22(%7* noalias sret %agg.result)' %t &&
+// RUN: grep -F 'void @f18(%2* noalias sret %agg.result)' %t &&
+// RUN: grep -F 'void @f19(%3* noalias sret %agg.result)' %t &&
+// RUN: grep -F 'void @f20(%4* noalias sret %agg.result)' %t &&
+// RUN: grep -F 'void @f21(%5* noalias sret %agg.result)' %t &&
+// RUN: grep -F 'void @f22(%6* noalias sret %agg.result)' %t &&
struct { T11 a; } f17(void) {}
struct { T12 a; } f18(void) {}
struct { T13 a; } f19(void) {}
@@ -129,4 +127,7 @@ struct s28 { int a; int b[]; } f28(void) {}
// RUN: grep 'define i16 @f29()' %t &&
struct s29 { struct { } a[1]; char b; char c; } f29(void) {}
+// RUN: grep 'define i16 @f30()' %t &&
+struct s30 { char a; char b : 4; } f30(void) {}
+
// RUN: true