diff options
-rw-r--r-- | lib/CodeGen/TargetInfo.cpp | 5 | ||||
-rw-r--r-- | test/CodeGenCXX/x86_64-arguments.cpp | 16 |
2 files changed, 19 insertions, 2 deletions
diff --git a/lib/CodeGen/TargetInfo.cpp b/lib/CodeGen/TargetInfo.cpp index 8729da9e17..0d8d3a9dff 100644 --- a/lib/CodeGen/TargetInfo.cpp +++ b/lib/CodeGen/TargetInfo.cpp @@ -1026,8 +1026,9 @@ void X86_64ABIInfo::classify(QualType Ty, uint64_t OffsetBase, break; } - // If this record has no fields but isn't empty, classify as INTEGER. - if (RD->field_empty() && Size) + // If this record has no fields, no bases, no vtable, but isn't empty, + // classify as INTEGER. + if (CXXRD->isEmpty() && Size) Current = Integer; } diff --git a/test/CodeGenCXX/x86_64-arguments.cpp b/test/CodeGenCXX/x86_64-arguments.cpp index 6c42bb8170..5dc79899c5 100644 --- a/test/CodeGenCXX/x86_64-arguments.cpp +++ b/test/CodeGenCXX/x86_64-arguments.cpp @@ -19,6 +19,7 @@ struct f2_s1 : public f2_s0 { char d;}; void f2(f2_s1 a0) { } // PR5831 +// CHECK: define void @_Z2f34s3_1(i8 %x.coerce0, i64 %x.coerce1) struct s3_0 {}; struct s3_1 { struct s3_0 a; long b; }; void f3(struct s3_1 x) {} @@ -44,4 +45,19 @@ void foo() { // CHECK: call void @_ZN6PR752310AddKeywordENS_9StringRefEi(i8* {{.*}}, i32 4) AddKeyword(StringRef(), 4); } +} + + + +namespace PR7742 { // Also rdar://8250764 + struct s2 { + float a[2]; + }; + + struct c2 : public s2 {}; + + // CHECK: define double @_ZN6PR77423fooEPNS_2c2E(%"struct.PR7742::c2"* %P) + c2 foo(c2 *P) { + } + }
\ No newline at end of file |