aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-12-24 20:21:41 +0000
committerAnders Carlsson <andersca@mac.com>2009-12-24 20:21:41 +0000
commit25c92e6c2936c279a58b41479e70806dbdeb0cdd (patch)
tree143a02d4c1ab3882c7a0b470a0d4e26ce765fd71
parent83a56c4a1d5bbf7e4b6b08b105051575a2421d34 (diff)
Add a test for x86-64 struct returns under gc.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92140 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/CodeGenObjC/x86-64-struct-return-gc.m31
1 files changed, 31 insertions, 0 deletions
diff --git a/test/CodeGenObjC/x86-64-struct-return-gc.m b/test/CodeGenObjC/x86-64-struct-return-gc.m
new file mode 100644
index 0000000000..32a321c0b7
--- /dev/null
+++ b/test/CodeGenObjC/x86-64-struct-return-gc.m
@@ -0,0 +1,31 @@
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-gc -emit-llvm -o - %s | FileCheck %s
+struct Coerce {
+ id a;
+};
+
+struct Coerce coerce_func(void);
+
+// CHECK: define void @Coerce_test()
+void Coerce_test(void) {
+ struct Coerce c;
+
+ // CHECK: call i64 @coerce_func
+ // CHECK: call i8* @objc_memmove_collectable(
+ c = coerce_func();
+}
+
+struct Indirect {
+ id a;
+ int b[10];
+};
+
+struct Indirect indirect_func(void);
+
+// CHECK: define void @Indirect_test()
+void Indirect_test(void) {
+ struct Indirect i;
+
+ // CHECK: call void @indirect_func(%struct.Indirect* noalias sret
+ // CHECK: call i8* @objc_memmove_collectable(
+ i = indirect_func();
+}