]> granicus.if.org Git - clang/commitdiff
Patch adds test to my previous patch for assigning to
authorFariborz Jahanian <fjahanian@apple.com>
Wed, 8 Jul 2009 16:37:44 +0000 (16:37 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Wed, 8 Jul 2009 16:37:44 +0000 (16:37 +0000)
gc'able structs in the Next runtime and adds missing
PCH info.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75014 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Frontend/PCHReaderDecl.cpp
lib/Frontend/PCHWriterDecl.cpp
test/CodeGenObjC/objc-gc-aggr-assign.m [new file with mode: 0644]

index 94e46acac3479b798cef92762cb53ef55b02e61c..308d73febf8af3f66e4626290cf936353ca2a011 100644 (file)
@@ -128,6 +128,7 @@ void PCHDeclReader::VisitRecordDecl(RecordDecl *RD) {
   VisitTagDecl(RD);
   RD->setHasFlexibleArrayMember(Record[Idx++]);
   RD->setAnonymousStructOrUnion(Record[Idx++]);
+  RD->setHasObjectMember(Record[Idx++]);
 }
 
 void PCHDeclReader::VisitValueDecl(ValueDecl *VD) {
index a6843e1b9efdc348a1ebd51ddf16c17bbb9d1436..c588a181dca5423684c0c253867219d533edf01c 100644 (file)
@@ -125,6 +125,7 @@ void PCHDeclWriter::VisitRecordDecl(RecordDecl *D) {
   VisitTagDecl(D);
   Record.push_back(D->hasFlexibleArrayMember());
   Record.push_back(D->isAnonymousStructOrUnion());
+  Record.push_back(D->hasObjectMember());
   Code = pch::DECL_RECORD;
 }
 
diff --git a/test/CodeGenObjC/objc-gc-aggr-assign.m b/test/CodeGenObjC/objc-gc-aggr-assign.m
new file mode 100644 (file)
index 0000000..b6b08ff
--- /dev/null
@@ -0,0 +1,42 @@
+// RUN: clang-cc -fnext-runtime -fobjc-gc -emit-llvm -o %t %s &&
+// RUN: grep objc_memmove_collectable %t | grep call | count 2
+
+static int count;
+
+typedef struct S {
+   int ii;
+} SS;
+
+struct type_s {
+   SS may_recurse;
+   id id_val;
+};
+
+@interface NamedObject
+{
+  struct type_s type_s_ivar;
+}
+- (void) setSome : (struct type_s) arg;
+- (struct type_s) getSome;
+@property(assign) struct type_s aggre_prop;
+@end
+
+@implementation NamedObject 
+- (void) setSome : (struct type_s) arg
+  {
+     type_s_ivar = arg;
+  }
+- (struct type_s) getSome 
+  {
+    return type_s_ivar;
+  }
+@synthesize aggre_prop = type_s_ivar;
+@end
+
+struct type_s some = {{1234}, (id)0};
+
+struct type_s get(void)
+{
+  return some;
+}
+