[cfe-commits] r92140 - /cfe/trunk/test/CodeGenObjC/x86-64-struct-return-gc.m

Anders Carlsson andersca at mac.com
Thu Dec 24 12:21:42 PST 2009


Author: andersca
Date: Thu Dec 24 14:21:41 2009
New Revision: 92140

URL: http://llvm.org/viewvc/llvm-project?rev=92140&view=rev
Log:
Add a test for x86-64 struct returns under gc.

Added:
    cfe/trunk/test/CodeGenObjC/x86-64-struct-return-gc.m

Added: cfe/trunk/test/CodeGenObjC/x86-64-struct-return-gc.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/x86-64-struct-return-gc.m?rev=92140&view=auto

==============================================================================
--- cfe/trunk/test/CodeGenObjC/x86-64-struct-return-gc.m (added)
+++ cfe/trunk/test/CodeGenObjC/x86-64-struct-return-gc.m Thu Dec 24 14:21:41 2009
@@ -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();
+}





More information about the cfe-commits mailing list