[cfe-commits] r138175 - in /cfe/trunk/test/CodeGenObjC: 2008-11-25-Blocks.m 2009-01-26-WriteBarrier-2.m 2009-02-05-VolatileProp.m 2009-08-05-utf16.m

Eric Christopher echristo at apple.com
Fri Aug 19 17:49:26 PDT 2011


Author: echristo
Date: Fri Aug 19 19:49:25 2011
New Revision: 138175

URL: http://llvm.org/viewvc/llvm-project?rev=138175&view=rev
Log:
Migrate, update and FileCheckize:

2008-11-25-Blocks.m
2009-01-26-WriteBarrier-2.m
2009-02-05-VolatileProp.m
2009-08-05-utf16.m

from llvm/test/FrontendObjC.

Added:
    cfe/trunk/test/CodeGenObjC/2008-11-25-Blocks.m
    cfe/trunk/test/CodeGenObjC/2009-01-26-WriteBarrier-2.m
    cfe/trunk/test/CodeGenObjC/2009-02-05-VolatileProp.m
    cfe/trunk/test/CodeGenObjC/2009-08-05-utf16.m

Added: cfe/trunk/test/CodeGenObjC/2008-11-25-Blocks.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/2008-11-25-Blocks.m?rev=138175&view=auto
==============================================================================
--- cfe/trunk/test/CodeGenObjC/2008-11-25-Blocks.m (added)
+++ cfe/trunk/test/CodeGenObjC/2008-11-25-Blocks.m Fri Aug 19 19:49:25 2011
@@ -0,0 +1,17 @@
+// RUN: %clang_cc1 -fblocks -emit-llvm %s -o /dev/null
+// rdar://6394879
+
+ at interface bork
+- (id)B:(void (^)())blk;
+- (void)C;
+ at end
+ at implementation bork
+- (id)B:(void (^)())blk {
+  __attribute__((__blocks__(byref))) bork* new = ((void *)0);
+  blk();
+}
+- (void)C {
+  __attribute__((__blocks__(byref))) id var;
+  [self B:^() {}];
+}
+ at end

Added: cfe/trunk/test/CodeGenObjC/2009-01-26-WriteBarrier-2.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/2009-01-26-WriteBarrier-2.m?rev=138175&view=auto
==============================================================================
--- cfe/trunk/test/CodeGenObjC/2009-01-26-WriteBarrier-2.m (added)
+++ cfe/trunk/test/CodeGenObjC/2009-01-26-WriteBarrier-2.m Fri Aug 19 19:49:25 2011
@@ -0,0 +1,19 @@
+// RUN: %clang_cc1 -fblocks -emit-llvm %s -fobjc-gc -o - | FileCheck %s
+
+// CHECK: objc_assign_strongCast
+// rdar://5541393
+
+typedef __SIZE_TYPE__ size_t;
+void * malloc(size_t size);
+
+typedef struct {
+    void (^ivarBlock)(void);
+} StructWithBlock_t;
+
+int main(int argc, char *argv[]) {
+   StructWithBlock_t *swbp = (StructWithBlock_t *)malloc(sizeof(StructWithBlock_t*));
+   __block   int i = 10;
+   // assigning a Block into an struct slot should elicit a write-barrier under GC
+   swbp->ivarBlock = ^ { ++i; };
+   return 0;
+}

Added: cfe/trunk/test/CodeGenObjC/2009-02-05-VolatileProp.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/2009-02-05-VolatileProp.m?rev=138175&view=auto
==============================================================================
--- cfe/trunk/test/CodeGenObjC/2009-02-05-VolatileProp.m (added)
+++ cfe/trunk/test/CodeGenObjC/2009-02-05-VolatileProp.m Fri Aug 19 19:49:25 2011
@@ -0,0 +1,10 @@
+// RUN: %clang -fexceptions -S -emit-llvm %s -o /dev/null -pedantic-errors
+// rdar://6551276
+
+void foo(const unsigned short *);
+void bar() {
+  unsigned short *s[3];
+  int i;
+  @try { } @catch (id anException) { }
+  foo(2+s[i]);
+}

Added: cfe/trunk/test/CodeGenObjC/2009-08-05-utf16.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/2009-08-05-utf16.m?rev=138175&view=auto
==============================================================================
--- cfe/trunk/test/CodeGenObjC/2009-08-05-utf16.m (added)
+++ cfe/trunk/test/CodeGenObjC/2009-08-05-utf16.m Fri Aug 19 19:49:25 2011
@@ -0,0 +1,5 @@
+// RUN: %clang_cc1 -emit-llvm -w -x objective-c %s -o - | FileCheck %s
+// rdar://7095855 rdar://7115749
+
+// CHECK: internal unnamed_addr constant [12 x i8]
+void *P = @"iPod™";





More information about the cfe-commits mailing list