diff options
| -rw-r--r-- | clang/lib/CodeGen/TargetABIInfo.cpp | 4 | ||||
| -rw-r--r-- | clang/test/CodeGen/arm-arguments.c | 8 | 
2 files changed, 12 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/TargetABIInfo.cpp b/clang/lib/CodeGen/TargetABIInfo.cpp index c403960580a..ebc3ecbd5cc 100644 --- a/clang/lib/CodeGen/TargetABIInfo.cpp +++ b/clang/lib/CodeGen/TargetABIInfo.cpp @@ -1395,6 +1395,10 @@ ABIArgInfo ARMABIInfo::classifyArgumentType(QualType Ty,      return (Ty->isPromotableIntegerType() ?              ABIArgInfo::getExtend() : ABIArgInfo::getDirect()); +  // Ignore empty records. +  if (isEmptyRecord(Context, Ty, true)) +    return ABIArgInfo::getIgnore(); +    // FIXME: This is kind of nasty... but there isn't much choice because the ARM    // backend doesn't support byval.    // FIXME: This doesn't handle alignment > 64 bits. diff --git a/clang/test/CodeGen/arm-arguments.c b/clang/test/CodeGen/arm-arguments.c index e58d2fddefc..c43ede2ca05 100644 --- a/clang/test/CodeGen/arm-arguments.c +++ b/clang/test/CodeGen/arm-arguments.c @@ -84,3 +84,11 @@ struct s13 f13(void) {}  // AAPCS: define arm_aapcscc i32 @f14()  union u14 { float f0; };  union u14 f14(void) {} + +// APCS-GNU: define arm_apcscc void @f15() +// AAPCS: define arm_aapcscc void @f15() +void f15(struct s7 a0) {} + +// APCS-GNU: define arm_apcscc void @f16() +// AAPCS: define arm_aapcscc void @f16() +void f16(struct s8 a0) {}  | 

