aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGen/mips64-class-return.cpp
diff options
context:
space:
mode:
authorAkira Hatanaka <ahatanaka@mips.com>2012-02-09 18:49:26 +0000
committerAkira Hatanaka <ahatanaka@mips.com>2012-02-09 18:49:26 +0000
commitda54ff306270e179f64d046369419724356d30d7 (patch)
treec3c4b16709934c7398ae67b15494283ec416c1d1 /test/CodeGen/mips64-class-return.cpp
parenta0c2b21e0d84ad289781e08e14148da6b8b8b76d (diff)
Fix bugs in function MipsABIInfo::returnAggregateInRegs. Functions returning
class objects follow the same rules as those returning struct objects. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150196 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/mips64-class-return.cpp')
-rw-r--r--test/CodeGen/mips64-class-return.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/test/CodeGen/mips64-class-return.cpp b/test/CodeGen/mips64-class-return.cpp
new file mode 100644
index 0000000000..eca8d5b2f7
--- /dev/null
+++ b/test/CodeGen/mips64-class-return.cpp
@@ -0,0 +1,31 @@
+// RUN: %clang -target mips64el-unknown-linux -ccc-clang-archs mips64el -O3 -S -mabi=n64 -o - -emit-llvm %s | FileCheck %s
+
+class B0 {
+ double d;
+};
+
+class D0 : public B0 {
+ float f;
+};
+
+class B1 {
+};
+
+class D1 : public B1 {
+ double d;
+ float f;
+};
+
+extern D0 gd0;
+extern D1 gd1;
+
+// CHECK: define { i64, i64 } @_Z4foo1v()
+D0 foo1(void) {
+ return gd0;
+}
+
+// CHECK: define { double, float } @_Z4foo2v()
+D1 foo2(void) {
+ return gd1;
+}
+