Syncing testsuite up with Apple's GCC testsuite.

llvm-svn: 56323
diff --git a/llvm-gcc-4.2/gcc/testsuite/g++.apple/block-copyconstructor.C b/llvm-gcc-4.2/gcc/testsuite/g++.apple/block-copyconstructor.C
new file mode 100644
index 0000000..074e80e
--- /dev/null
+++ b/llvm-gcc-4.2/gcc/testsuite/g++.apple/block-copyconstructor.C
@@ -0,0 +1,83 @@
+/* APPLE LOCAL file radar 6169527 */
+/* Test for proper use of copy constructors in setting up various block
+   support code. */
+/* { dg-do run } */
+/* { dg-options "-mmacosx-version-min=10.6 " { target *-*-darwin* } } */
+
+#import <Block.h>
+#include <stdio.h>
+
+int constructors = 0;
+int destructors = 0;
+
+#define CONST const
+
+class TestObject
+{
+public:
+	TestObject(CONST TestObject& inObj);
+	TestObject();
+	~TestObject();
+	
+	TestObject& operator=(CONST TestObject& inObj);
+
+	int version() CONST { return _version; }
+private:
+	mutable int _version;
+};
+
+TestObject::TestObject(CONST TestObject& inObj)
+	
+{
+        ++constructors;
+        _version = inObj._version;
+	printf("%p (%d) -- TestObject(const TestObject&) called", this, _version); 
+}
+
+
+TestObject::TestObject()
+{
+        _version = ++constructors;
+	printf("%p (%d) -- TestObject() called\n", this, _version); 
+}
+
+
+TestObject::~TestObject()
+{
+	printf("%p -- ~TestObject() called\n", this);
+        ++destructors;
+}
+
+
+TestObject& TestObject::operator=(CONST TestObject& inObj)
+{
+	printf("%p -- operator= called", this);
+        _version = inObj._version;
+	return *this;
+}
+
+void simpletest() {
+    TestObject one;
+    TestObject two;
+    printf("one (%d) two (%d)\n", one.version(), two.version());
+    one = two;
+    printf(" after one = two, one (%d) two (%d)\n", one.version(), two.version());
+}
+
+
+void testRoutine() {
+    TestObject one;
+    
+    void (^b)(void) = ^{ printf("my const copy of one is %d\n", one.version()); };
+}
+    
+int main(char *argc, char *argv[]) {
+    //simpletest();
+    testRoutine();
+    if (constructors != 0) {
+        printf("%s: success\n", argv[0]);
+        return 0;
+    }
+    printf("%s: *** didn't copy construct\n", argv[0]);
+    return 1;
+}
diff --git a/llvm-gcc-4.2/gcc/testsuite/g++.apple/block-dynamic-array.C b/llvm-gcc-4.2/gcc/testsuite/g++.apple/block-dynamic-array.C
new file mode 100644
index 0000000..140e5ad
--- /dev/null
+++ b/llvm-gcc-4.2/gcc/testsuite/g++.apple/block-dynamic-array.C
@@ -0,0 +1,74 @@
+/* APPLE LOCAL file radar 6212722 */
+/* Test for use of array (dynamic or static) as copied in object in a block. */
+/* { dg-options "-mmacosx-version-min=10.6 -ObjC++ -framework Foundation" { target *-*-darwin* } } */
+/* { dg-do run } */
+
+#import <Foundation/Foundation.h>
+#import <Block.h>
+
+
+int _getArrayCount() {return 5;}
+
+
+int func ()
+{
+	NSAutoreleasePool *pool	= [[NSAutoreleasePool alloc] init];
+
+	int array[5];
+	
+	int i;
+	const int c = 5;
+	for (i = 0; i < c; ++i)
+	{
+		array[i] = i+1;
+	}
+	
+	void (^block)(void) = ^{
+	
+		int i;
+		NSLog (@"c = %d", c);
+		for (i = 0; i < c; ++i)
+		{
+			NSLog (@"array[%d] = %d", i, array[i]);
+		}
+	
+	};
+	
+	block();
+
+	[pool drain];
+	return 0;
+}
+
+int main (int argc, const char *argv[])
+{
+        int res;
+	NSAutoreleasePool *pool	= [[NSAutoreleasePool alloc] init];
+
+	int array[_getArrayCount()];
+	
+	int i;
+	const int c = _getArrayCount();
+	for (i = 0; i < c; ++i)
+	{
+		array[i] = i+1;
+	}
+	
+	void (^block)(void) = ^{
+	
+		int i;
+		//const int c = _getArrayCount();
+		NSLog (@"c = %d", c);
+		for (i = 0; i < c; ++i)
+		{
+			NSLog (@"array[%d] = %d", i, array[i]);
+		}
+	
+	};
+	
+	block();
+	res = func();
+
+	[pool drain];
+	return 0 + res;
+}
diff --git a/llvm-gcc-4.2/gcc/testsuite/g++.apple/block-explicit-return-type.C b/llvm-gcc-4.2/gcc/testsuite/g++.apple/block-explicit-return-type.C
new file mode 100644
index 0000000..fb2891d
--- /dev/null
+++ b/llvm-gcc-4.2/gcc/testsuite/g++.apple/block-explicit-return-type.C
@@ -0,0 +1,83 @@
+/* APPLE LOCAL file radar 6185344 */
+/* Test for blocks with explicit return type specified. */
+/* { dg-options "-mmacosx-version-min=10.6 -ObjC++" { target *-*-darwin* } } */
+/* { dg-do compile } */
+
+typedef float * PF;
+float gf;
+
+@interface NSView
+  - (id) some_method_that_returns_id;
+@end
+
+NSView *some_object;
+
+void some_func (NSView * (^) (id));
+
+typedef struct dispatch_item_s *dispatch_item_t;
+typedef void (^completion_block_t)(void);
+
+typedef double (^myblock)(int);
+double test(myblock I);
+
+int main()
+{
+	 __block int x = 1;
+ 	__block int y = 2;
+
+	^void *{ return 0; };
+
+	^float(float y){ return y; };
+
+	^double (float y, double d) 
+           {
+	      if (y)
+	       return d;
+	      else
+	       return y;
+	   };
+
+	const char * (^chb) (int flag, const char *arg, char *arg1) = ^ const char * (int flag, const char *arg, char *arg1) { 
+	  if (flag)
+	    return 0;
+	  if (flag == 1)
+	    return arg;
+          else if (flag == 2)
+	    return "";
+	  return arg1; 
+	};
+
+	^PF { return &gf; };
+
+	some_func(^ NSView * (id whatever) { return [some_object some_method_that_returns_id]; });
+
+	double res = test(^double (int z){x = y+z; return z; });	
+}
+
+void func()
+{
+  completion_block_t X;
+
+  completion_block_t (^blockx)(dispatch_item_t) = ^completion_block_t (dispatch_item_t item) {
+    return X;
+  };
+
+  completion_block_t (^blocky)(dispatch_item_t) = ^(dispatch_item_t item) {
+    return X;
+  };
+
+  blockx = blocky;
+
+}
+
+
+// intent: block taking int returning block that takes char,int and returns int
+int (^(^block)(double x))(char, short);
+
+void foo() {
+   block = ^(double x){ return ^int(char c, short y) { return c + y; };};  /* { dg-warning "returning block that lives on the local stack" } */
+   // or:
+   block = ^(double x){ return ^(char c, short y) { return (int)c + y; };};  /* { dg-warning "returning block that lives on the local stack" } */
+}
+
+
diff --git a/llvm-gcc-4.2/gcc/testsuite/g++.apple/block-reference-in-method.C b/llvm-gcc-4.2/gcc/testsuite/g++.apple/block-reference-in-method.C
new file mode 100644
index 0000000..fb5ef1b
--- /dev/null
+++ b/llvm-gcc-4.2/gcc/testsuite/g++.apple/block-reference-in-method.C
@@ -0,0 +1,95 @@
+/* APPLE LOCAL file radar 6169580 */
+/* Test use of blocks in member functions. */
+/* { dg-do run } */
+/* { dg-options "-mmacosx-version-min=10.6 " { target *-*-darwin* } } */
+
+#import <Block.h>
+#include <stdio.h>
+
+int recovered = 0;
+
+
+#ifdef __cplusplus
+
+int constructors = 0;
+int destructors = 0;
+
+#define CONST const
+
+class TestObject
+{
+public:
+	TestObject(CONST TestObject& inObj);
+	TestObject();
+	~TestObject();
+	
+	TestObject& operator=(CONST TestObject& inObj);
+        
+        void test(void);
+
+	int version() CONST { return _version; }
+private:
+	mutable int _version;
+};
+
+TestObject::TestObject(CONST TestObject& inObj)
+	
+{
+        ++constructors;
+        _version = inObj._version;
+	printf("%p (%d) -- TestObject(const TestObject&) called", this, _version); 
+}
+
+
+TestObject::TestObject()
+{
+        _version = ++constructors;
+	printf("%p (%d) -- TestObject() called\n", this, _version); 
+}
+
+
+TestObject::~TestObject()
+{
+	printf("%p -- ~TestObject() called\n", this);
+        ++destructors;
+}
+
+#if 1
+TestObject& TestObject::operator=(CONST TestObject& inObj)
+{
+	printf("%p -- operator= called", this);
+        _version = inObj._version;
+	return *this;
+}
+#endif
+
+void TestObject::test(void)  {
+    void (^b)(void) = ^{ recovered = _version; };
+    b();
+}
+
+#endif
+
+
+void testRoutine() {
+#ifdef __cplusplus
+    TestObject one;
+
+    
+    one.test();
+#else
+    recovered = 1;
+#endif
+}
+    
+    
+
+int main(char *argc, char *argv[]) {
+    testRoutine();
+    if (recovered == 1) {
+        printf("%s: success\n", argv[0]);
+        return (0);
+    }
+    printf("%s: *** didn't recover byref block variable\n", argv[0]);
+    return (1);
+}
diff --git a/llvm-gcc-4.2/gcc/testsuite/g++.apple/blocks-recovercpp.C b/llvm-gcc-4.2/gcc/testsuite/g++.apple/blocks-recovercpp.C
new file mode 100644
index 0000000..a13a0eb
--- /dev/null
+++ b/llvm-gcc-4.2/gcc/testsuite/g++.apple/blocks-recovercpp.C
@@ -0,0 +1,104 @@
+/* APPLE LOCAL file radar 6214617 */
+/* { dg-options "-mmacosx-version-min=10.5 -ObjC++" { target *-*-darwin* } } */
+/* { dg-do run } */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+int constructors = 0;
+int destructors = 0;
+
+void * _NSConcreteStackBlock[32];
+
+#define CONST const
+
+class TestObject
+{
+public:
+	TestObject(CONST TestObject& inObj);
+	TestObject();
+	~TestObject();
+	
+	TestObject& operator=(CONST TestObject& inObj);
+
+	int version() CONST { return _version; }
+private:
+	mutable int _version;
+};
+
+TestObject::TestObject(CONST TestObject& inObj)
+	
+{
+        ++constructors;
+        _version = inObj._version;
+	printf("%p (%d) -- TestObject(const TestObject&) called\n", this, _version); 
+}
+
+
+TestObject::TestObject()
+{
+        _version = ++constructors;
+	printf("%p (%d) -- TestObject() called\n", this, _version); 
+}
+
+
+TestObject::~TestObject()
+{
+	printf("%p -- ~TestObject() called\n", this);
+        ++destructors;
+}
+
+
+TestObject& TestObject::operator=(CONST TestObject& inObj)
+{
+	printf("%p -- operator= called\n", this);
+        _version = inObj._version;
+	return *this;
+}
+
+void hack(void *block) {
+    // check flags to see if constructor/destructor is available;
+    struct myblock {
+        void *isa;
+        int flags;
+        int refcount;
+        void *invokeptr;
+        void (*copyhelper)(struct myblock *dst, struct myblock *src);
+        void (*disposehelper)(struct myblock *src);
+        long space[32];
+    } myversion, *mbp = (struct myblock *)block;
+    printf("flags -> %x\n", mbp->flags);
+    if (! ((1<<25) & mbp->flags)) {
+        printf("no copy/dispose helper functions provided!\n");
+        exit(1);
+    }
+    if (! ((1<<26) & mbp->flags)) {
+        printf("no marking for ctor/dtors present!\n");
+        exit(1);
+    }
+    printf("copyhelper -> %p\n", mbp->copyhelper);
+    // simulate copy
+    mbp->copyhelper(&myversion, mbp);
+    if (constructors != 3) {
+        printf("copy helper didn't do the constructor part\n");
+        exit(1);
+    }
+    printf("disposehelper -> %p\n", mbp->disposehelper);
+    // simulate destroy
+    mbp->disposehelper(&myversion);
+    if (destructors != 1) {
+        printf("dispose helper didn't do the dispose\n");
+        exit(1);
+    }
+}
+void testRoutine() {
+    TestObject one;
+    
+    void (^b)(void) = ^{ printf("my copy of one is %d\n", one.version()); };
+    hack(b);
+}
+
+int main(char *argc, char *argv[]) {
+    testRoutine();
+    exit(0);
+}
diff --git a/llvm-gcc-4.2/gcc/testsuite/g++.apple/ctor.C b/llvm-gcc-4.2/gcc/testsuite/g++.apple/ctor.C
new file mode 100644
index 0000000..23d5bfd
--- /dev/null
+++ b/llvm-gcc-4.2/gcc/testsuite/g++.apple/ctor.C
@@ -0,0 +1,8 @@
+/* APPLE LOCAL file ctor name 6202462 */
+class A {
+  virtual int B() { return 0; }
+};
+
+class B: A {
+  B() { }
+};
diff --git a/llvm-gcc-4.2/gcc/testsuite/g++.apple/mips-linkage-name.C b/llvm-gcc-4.2/gcc/testsuite/g++.apple/mips-linkage-name.C
new file mode 100644
index 0000000..7459da5
--- /dev/null
+++ b/llvm-gcc-4.2/gcc/testsuite/g++.apple/mips-linkage-name.C
@@ -0,0 +1,13 @@
+/* Radar 6066486 */
+/* { dg-do compile { target *-*-darwin* } } */
+/* { dg-options "-O0 -gdwarf-2 -dA" } */
+/* { dg-final { scan-assembler-not "DW_AT_MIPS_linkage_name" } }*/
+
+#include <unistd.h>
+
+int main (int argc, char **argv)
+{
+  static int spin = 1;
+  while (spin) sleep (1);
+}
+
diff --git a/llvm-gcc-4.2/gcc/testsuite/g++.apple/unwind-1.C b/llvm-gcc-4.2/gcc/testsuite/g++.apple/unwind-1.C
new file mode 100644
index 0000000..ae53f26
--- /dev/null
+++ b/llvm-gcc-4.2/gcc/testsuite/g++.apple/unwind-1.C
@@ -0,0 +1,35 @@
+/* APPLE LOCAL file 6205688 */
+/* { dg-do run } */
+#include <stdio.h>
+
+void fn2(int i) __attribute__((noinline));
+void fn2(int i) {
+  printf("fn2 %d\n", i);
+}
+
+int fn3(int i) __attribute__((noinline));
+int fn3(int i) {
+  if (i) return i+1;
+  else throw 1;
+}
+
+void fn(int i) __attribute__((noinline));
+void fn(int i) {
+  if (i) {
+    fn2(i);
+  } else {
+    int j = fn3(i);
+    printf("j %d\n", j);
+  }
+}
+
+volatile int arg = 0;
+
+int main(int argc, char **argv) {
+  try {
+    fn(arg);
+  } catch (int e) {
+    printf("caught %d\n", e);
+  }
+  return 0;
+}
diff --git a/llvm-gcc-4.2/gcc/testsuite/g++.dg/ext/apple-r4168392.C b/llvm-gcc-4.2/gcc/testsuite/g++.dg/ext/apple-r4168392.C
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/llvm-gcc-4.2/gcc/testsuite/g++.dg/ext/apple-r4168392.C
diff --git a/llvm-gcc-4.2/gcc/testsuite/g++.dg/warn/anonymous-namespace-1.C b/llvm-gcc-4.2/gcc/testsuite/g++.dg/warn/anonymous-namespace-1.C
new file mode 100644
index 0000000..e897d83
--- /dev/null
+++ b/llvm-gcc-4.2/gcc/testsuite/g++.dg/warn/anonymous-namespace-1.C
@@ -0,0 +1,19 @@
+// APPLE LOCAL file mainline radar 6194879
+// Test for the warning of exposing types from an anonymous namespace
+// { dg-do compile }
+
+#include "anonymous-namespace-1.h"
+
+namespace {
+ class good { };
+}
+
+class foo::bar : public good { }; 
+class foobar1
+{
+  good g;
+};
+
+#line 18 "foo.C"
+class foobar : public bad { }; // { dg-warning "uses the anonymous namespace" }
+class foobar2 { bad b; }; // { dg-warning "uses the anonymous namespace" }
diff --git a/llvm-gcc-4.2/gcc/testsuite/g++.dg/warn/anonymous-namespace-1.h b/llvm-gcc-4.2/gcc/testsuite/g++.dg/warn/anonymous-namespace-1.h
new file mode 100644
index 0000000..cd45c40
--- /dev/null
+++ b/llvm-gcc-4.2/gcc/testsuite/g++.dg/warn/anonymous-namespace-1.h
@@ -0,0 +1,8 @@
+// APPLE LOCAL file mainline radar 6194879
+class foo {
+ class bar;
+};
+
+namespace {
+  class bad { };
+}
diff --git a/llvm-gcc-4.2/gcc/testsuite/g++.dg/warn/anonymous-namespace-2.C b/llvm-gcc-4.2/gcc/testsuite/g++.dg/warn/anonymous-namespace-2.C
new file mode 100644
index 0000000..d75609a
--- /dev/null
+++ b/llvm-gcc-4.2/gcc/testsuite/g++.dg/warn/anonymous-namespace-2.C
@@ -0,0 +1,29 @@
+// APPLE LOCAL file mainline radar 6194879
+// Test for the warning of exposing types from an anonymous namespace
+// { dg-do compile }
+//
+#include "anonymous-namespace-2.h"
+
+namespace {
+    struct good { };
+}
+
+struct g1 {
+    good * A;
+};
+struct g2 {
+    good * A[1];
+};
+struct g3 {
+    good (*A)[1];
+};
+#line 21 "foo.C"
+struct b1 { // { dg-warning "uses the anonymous namespace" }
+    bad * B;
+};
+struct b2 { // { dg-warning "uses the anonymous namespace" }
+    bad * B[1];
+};
+struct b3 { // { dg-warning "uses the anonymous namespace" }
+    bad (*B)[1];
+};
diff --git a/llvm-gcc-4.2/gcc/testsuite/g++.dg/warn/anonymous-namespace-2.h b/llvm-gcc-4.2/gcc/testsuite/g++.dg/warn/anonymous-namespace-2.h
new file mode 100644
index 0000000..33a8795
--- /dev/null
+++ b/llvm-gcc-4.2/gcc/testsuite/g++.dg/warn/anonymous-namespace-2.h
@@ -0,0 +1,4 @@
+// APPLE LOCAL file mainline radar 6194879
+namespace {
+  struct bad { };
+}
diff --git a/llvm-gcc-4.2/gcc/testsuite/gcc.apple/block-byref-dynamic-array.c b/llvm-gcc-4.2/gcc/testsuite/gcc.apple/block-byref-dynamic-array.c
new file mode 100644
index 0000000..89cd711
--- /dev/null
+++ b/llvm-gcc-4.2/gcc/testsuite/gcc.apple/block-byref-dynamic-array.c
@@ -0,0 +1,26 @@
+/* APPLE LOCAL file radar 6217257 */
+/* __block cannot be used on dynamic array declaration due to block's runtime
+   limitations. This test detects and flags as error such cases. */
+/* { dg-options "-mmacosx-version-min=10.6 -ObjC" { target *-*-darwin* } } */
+/* { dg-do compile } */
+
+int size=5;
+
+int main() {
+  __block int array[size];	/* { dg-error "__block not allowed on a variable length array declaration" } */
+
+  __block id aid1[size];	/* { dg-error "__block not allowed on a variable length array declaration" } */
+
+ __block id aid2[2][size];	/* { dg-error "__block not allowed on a variable length array declaration" } */
+
+ __block id aid3[][size];	/* { dg-error "__block not allowed on a variable length array declaration" } */
+				/* { dg-error "array size missing in" "" { target *-*-* } 16 } */
+
+
+ __block id oid1 [1];
+ __block id oid2 [2][3];
+ __block id oid4 [][1];	/* { dg-error "__block not allowed on a variable length array declaration" } */
+		        /* { dg-error "array size missing in" "" { target *-*-* } 22 } */
+ return 0;
+}
+
diff --git a/llvm-gcc-4.2/gcc/testsuite/gcc.apple/block-dynamic-array.c b/llvm-gcc-4.2/gcc/testsuite/gcc.apple/block-dynamic-array.c
new file mode 100644
index 0000000..8b5fdc7
--- /dev/null
+++ b/llvm-gcc-4.2/gcc/testsuite/gcc.apple/block-dynamic-array.c
@@ -0,0 +1,74 @@
+/* APPLE LOCAL file radar 6212722 */
+/* Test for use of array (dynamic or static) as copied in object in a block. */
+/* { dg-options "-mmacosx-version-min=10.6 -ObjC -framework Foundation" { target *-*-darwin* } } */
+/* { dg-do run } */
+
+#import <Foundation/Foundation.h>
+#import <Block.h>
+
+
+int _getArrayCount() {return 5;}
+
+
+int func ()
+{
+	NSAutoreleasePool *pool	= [[NSAutoreleasePool alloc] init];
+
+	int array[5];
+	
+	int i;
+	const int c = 5;
+	for (i = 0; i < c; ++i)
+	{
+		array[i] = i+1;
+	}
+	
+	void (^block)(void) = ^{
+	
+		int i;
+		NSLog (@"c = %d", c);
+		for (i = 0; i < c; ++i)
+		{
+			NSLog (@"array[%d] = %d", i, array[i]);
+		}
+	
+	};
+	
+	block();
+
+	[pool drain];
+	return 0;
+}
+
+int main (int argc, const char *argv[])
+{
+        int res;
+	NSAutoreleasePool *pool	= [[NSAutoreleasePool alloc] init];
+
+	int array[_getArrayCount()];
+	
+	int i;
+	const int c = _getArrayCount();
+	for (i = 0; i < c; ++i)
+	{
+		array[i] = i+1;
+	}
+	
+	void (^block)(void) = ^{
+	
+		int i;
+		//const int c = _getArrayCount();
+		NSLog (@"c = %d", c);
+		for (i = 0; i < c; ++i)
+		{
+			NSLog (@"array[%d] = %d", i, array[i]);
+		}
+	
+	};
+	
+	block();
+	res = func();
+
+	[pool drain];
+	return 0 + res;
+}
diff --git a/llvm-gcc-4.2/gcc/testsuite/gcc.apple/block-explicit-return-type.c b/llvm-gcc-4.2/gcc/testsuite/gcc.apple/block-explicit-return-type.c
new file mode 100644
index 0000000..6b60bbf
--- /dev/null
+++ b/llvm-gcc-4.2/gcc/testsuite/gcc.apple/block-explicit-return-type.c
@@ -0,0 +1,83 @@
+/* APPLE LOCAL file radar 6185344 */
+/* Test for blocks with explicit return type specified. */
+/* { dg-options "-mmacosx-version-min=10.6 -ObjC" { target *-*-darwin* } } */
+/* { dg-do compile } */
+
+typedef float * PF;
+float gf;
+
+@interface NSView
+  - (id) some_method_that_returns_id;
+@end
+
+NSView *some_object;
+
+void some_func (NSView * (^) (id));
+
+typedef struct dispatch_item_s *dispatch_item_t;
+typedef void (^completion_block_t)(void);
+
+typedef double (^myblock)(int);
+double test(myblock I);
+
+int main()
+{
+	 __block int x = 1;
+ 	__block int y = 2;
+
+	^void *{ return 0; };
+
+	^float(float y){ return y; };
+
+	^double (float y, double d) 
+           {
+	      if (y)
+	       return d;
+	      else
+	       return y;
+	   };
+
+	const char * (^chb) (int flag, const char *arg, char *arg1) = ^ const char * (int flag, const char *arg, char *arg1) { 
+	  if (flag)
+	    return 0;
+	  if (flag == 1)
+	    return arg;
+          else if (flag == 2)
+	    return "";
+	  return arg1; 
+	};
+
+	^PF { return &gf; };
+
+	some_func(^ NSView * (id whatever) { return [some_object some_method_that_returns_id]; });
+
+	double res = test(^double (int z){x = y+z; return z; });	
+}
+
+void func()
+{
+  completion_block_t X;
+
+  completion_block_t (^blockx)(dispatch_item_t) = ^completion_block_t (dispatch_item_t item) {
+    return X;
+  };
+
+  completion_block_t (^blocky)(dispatch_item_t) = ^(dispatch_item_t item) {
+    return X;
+  };
+
+  blockx = blocky;
+
+}
+
+
+// intent: block taking int returning block that takes char,int and returns int
+int (^(^block)(double x))(char, short);
+
+void foo() {
+   block = ^(double x){ return ^int(char c, short y) { return c + y; };};  /* { dg-warning "returning block that lives on the local stack" } */
+   // or:
+   block = ^(double x){ return ^(char c, short y) { return (int)c + y; };};  /* { dg-warning "returning block that lives on the local stack" } */
+}
+
+
diff --git a/llvm-gcc-4.2/gcc/testsuite/gcc.apple/format-security-attribute-3.c b/llvm-gcc-4.2/gcc/testsuite/gcc.apple/format-security-attribute-3.c
new file mode 100644
index 0000000..0a7d73e
--- /dev/null
+++ b/llvm-gcc-4.2/gcc/testsuite/gcc.apple/format-security-attribute-3.c
@@ -0,0 +1,8 @@
+/* APPLE LOCAL file radar 6212507 */
+/* This for incorrect specification of format number argument. */
+/* { dg-options "-fconstant-cfstrings -Wformat -Wformat-security" } */
+/* { dg-do compile { target *-*-darwin* } } */
+
+#include <CoreFoundation/CoreFoundation.h>
+void doSomething(CFStringRef format, CFStringRef bla) __attribute__((format(CFString, 0, 1))); /* { dg-error "argument number of CFString format cannot be less than one" } */
+
diff --git a/llvm-gcc-4.2/gcc/testsuite/obj-c++.dg/property-synthesize-ivar-10.mm b/llvm-gcc-4.2/gcc/testsuite/obj-c++.dg/property-synthesize-ivar-10.mm
new file mode 100644
index 0000000..087b3fa
--- /dev/null
+++ b/llvm-gcc-4.2/gcc/testsuite/obj-c++.dg/property-synthesize-ivar-10.mm
@@ -0,0 +1,35 @@
+/* APPLE LOCAL file radar 6209554 */
+/* Better messages for bad property declarations. */
+/* { dg-options "-fnew-property-ivar-synthesis -mmacosx-version-min=10.5" { target powerpc*-*-darwin* i?86*-*-darwin* } } */
+/* { dg-options "-fnew-property-ivar-synthesis -fobjc-new-property" { target arm*-*-darwin* } } */
+/* { dg-do compile { target *-*-darwin* } } */
+
+@interface I
+{
+	int _p;
+	int _p3;
+	int _p4;
+}
+@property int p;
+@property int p1;
+@property int p3;
+@property int p4;
+@end
+
+@implementation I
+
+@dynamic p3; /* { dg-error "previous property declaration of \\'p3\\' was here" } */
+@dynamic p4;	/* { dg-error "previous property declaration of \\'p4\\' was here" } */
+@synthesize p = _p; /* { dg-error "previous property declaration of \\'p\\' was here" } */
+
+
+@synthesize p1 = _p;  /* { dg-error "synthesized properties \\'p1\\' and \\'p\\' both claim ivar \\'_p\\'" } */
+
+@dynamic p3;  /* { dg-error "property \\'p3\\' is already implemented" } */
+
+@synthesize p4=_p4;	/* { dg-error "property \\'p4\\' is already implemented" } */
+
+
+@end
+
+
diff --git a/llvm-gcc-4.2/gcc/testsuite/objc.dg/objc-gc-1-64bit.m b/llvm-gcc-4.2/gcc/testsuite/objc.dg/objc-gc-1-64bit.m
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/llvm-gcc-4.2/gcc/testsuite/objc.dg/objc-gc-1-64bit.m
diff --git a/llvm-gcc-4.2/gcc/testsuite/objc.dg/objc-gc-5-64bit.m b/llvm-gcc-4.2/gcc/testsuite/objc.dg/objc-gc-5-64bit.m
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/llvm-gcc-4.2/gcc/testsuite/objc.dg/objc-gc-5-64bit.m
diff --git a/llvm-gcc-4.2/gcc/testsuite/objc.dg/property-synthesize-ivar-10.m b/llvm-gcc-4.2/gcc/testsuite/objc.dg/property-synthesize-ivar-10.m
new file mode 100644
index 0000000..087b3fa
--- /dev/null
+++ b/llvm-gcc-4.2/gcc/testsuite/objc.dg/property-synthesize-ivar-10.m
@@ -0,0 +1,35 @@
+/* APPLE LOCAL file radar 6209554 */
+/* Better messages for bad property declarations. */
+/* { dg-options "-fnew-property-ivar-synthesis -mmacosx-version-min=10.5" { target powerpc*-*-darwin* i?86*-*-darwin* } } */
+/* { dg-options "-fnew-property-ivar-synthesis -fobjc-new-property" { target arm*-*-darwin* } } */
+/* { dg-do compile { target *-*-darwin* } } */
+
+@interface I
+{
+	int _p;
+	int _p3;
+	int _p4;
+}
+@property int p;
+@property int p1;
+@property int p3;
+@property int p4;
+@end
+
+@implementation I
+
+@dynamic p3; /* { dg-error "previous property declaration of \\'p3\\' was here" } */
+@dynamic p4;	/* { dg-error "previous property declaration of \\'p4\\' was here" } */
+@synthesize p = _p; /* { dg-error "previous property declaration of \\'p\\' was here" } */
+
+
+@synthesize p1 = _p;  /* { dg-error "synthesized properties \\'p1\\' and \\'p\\' both claim ivar \\'_p\\'" } */
+
+@dynamic p3;  /* { dg-error "property \\'p3\\' is already implemented" } */
+
+@synthesize p4=_p4;	/* { dg-error "property \\'p4\\' is already implemented" } */
+
+
+@end
+
+