]> granicus.if.org Git - clang/commitdiff
More Objective-C++ GC tests.
authorFariborz Jahanian <fjahanian@apple.com>
Thu, 20 May 2010 18:22:28 +0000 (18:22 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Thu, 20 May 2010 18:22:28 +0000 (18:22 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104253 91177308-0d34-0410-b5e6-96231b3b80d8

14 files changed:
test/CodeGenObjC/objc2-new-gc-api-strongcast.m
test/CodeGenObjC/objc2-no-write-barrier.m
test/CodeGenObjC/objc2-retain-codegen.m
test/CodeGenObjC/objc2-strong-cast-1.m
test/CodeGenObjC/objc2-strong-cast.m
test/CodeGenObjC/objc2-weak-assign.m
test/CodeGenObjC/objc2-weak-compare.m
test/CodeGenObjC/objc2-weak-ivar-debug.m
test/CodeGenObjC/objc2-weak-ivar.m
test/CodeGenObjC/objc2-write-barrier-2.m
test/CodeGenObjC/objc2-write-barrier-3.m
test/CodeGenObjC/objc2-write-barrier-4.m
test/CodeGenObjC/objc2-write-barrier-5.m
test/CodeGenObjC/objc2-write-barrier.m

index 1ff2dd3d8de27def32a7ac405f3f42c9ea515cbb..0413910855e587049ccc3dfe959b6322d5fb9388 100644 (file)
@@ -1,9 +1,11 @@
 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fblocks -fobjc-gc -emit-llvm -o %t %s
 // RUN: grep -F '@objc_assign_strongCast' %t  | count 4
+// RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin10 -fblocks -fobjc-gc -emit-llvm -o %t %s
+// RUN: grep -F '@objc_assign_strongCast' %t  | count 4
 
 @interface DSATextSearch @end
 
-DSATextSearch **_uniqueIdToIdentifierArray = ((void *)0);
+DSATextSearch **_uniqueIdToIdentifierArray = (0);
 void foo (int _nextId)
 {
        _uniqueIdToIdentifierArray[_nextId] = 0;  // objc_assign_strongCast
index 544c329c5e2016b36095e9c35e675f5b6ce2c394..a0ebc100fb2f4ba382eddac1e7969995b106521f 100644 (file)
@@ -1,5 +1,7 @@
 // RUN: %clang_cc1 -triple x86_64-apple-darwin9 -fobjc-gc -emit-llvm -o %t %s
 // RUN: grep 'objc_assign' %t | count 0
+// RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin9 -fobjc-gc -emit-llvm -o %t %s
+// RUN: grep 'objc_assign' %t | count 0
 
 typedef struct {
     int ival;
index 2c3317a4854de24768c7d68684ed11ce94c5d0a6..9f6620619ecdbdd967780a4a63b18971828fb743 100644 (file)
@@ -1,4 +1,5 @@
 // RUN: %clang_cc1 -triple x86_64-unknown-unknown -fobjc-gc-only -emit-llvm -o %t %s
+// RUN: %clang_cc1 -x objective-c++ -triple x86_64-unknown-unknown -fobjc-gc-only -emit-llvm -o %t %s
 
 @interface I0 {
   I0 *_f0;
index 509f21a342ae7fdde9b0954022e8045a0e89371b..b79f8a00f7a32bf0880af15ecfc572b57e649523 100644 (file)
@@ -1,4 +1,5 @@
 // RUN: %clang_cc1 -triple x86_64-unknown-unknown -fobjc-gc -emit-llvm -o %t %s
+// RUN: %clang_cc1 -x objective-c++ -triple x86_64-unknown-unknown -fobjc-gc -emit-llvm -o %t %s
 
 @interface I {
   __attribute__((objc_gc(strong))) int *i_IdocumentIDs;
index 9ef463c0df100de8878e8743c249146156a09ffd..7291c4e8d2d446b3ac939d4223855305067e768b 100644 (file)
@@ -1,4 +1,5 @@
 // RUN: %clang_cc1 -fobjc-gc -emit-llvm -o %t %s
+// RUN: %clang_cc1 -x objective-c++ -fobjc-gc -emit-llvm -o %t %s
 
 @interface I {
   __attribute__((objc_gc(strong))) signed long *_documentIDs;
index 42fa7738f44e6be788bd7a734c9c23708bdde201..74c0c00c7caa5b42e3564f7b07ad728e33d24522 100644 (file)
@@ -1,5 +1,7 @@
 // RUN: %clang_cc1 -triple x86_64-apple-darwin9 -fobjc-gc -emit-llvm -o %t %s
 // RUN: grep -e "objc_assign_weak" %t | grep -e "call" | count 6
+// RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin9 -fobjc-gc -emit-llvm -o %t %s
+// RUN: grep -e "objc_assign_weak" %t | grep -e "call" | count 6
 
 __weak id* x;
 id* __weak y;
index cb8ca5ff4c077ec05b806cf0d24b775abc0b3765..8cba1a9860942429a0421628468c7c629464c038 100644 (file)
@@ -1,4 +1,5 @@
 // RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-gc -emit-llvm -o %t %s
+// RUN: %clang_cc1 -x objective-c++ -triple i386-apple-darwin9 -fobjc-gc -emit-llvm -o %t %s
 
 @interface PBXTarget 
 {
@@ -10,6 +11,7 @@ PBXTarget * result;
 - Meth;
 @end
 
+extern void foo();
 @implementation PBXTarget
 - Meth {
        if (_lastKnownTarget != result)
index a6fb7fa2751fab7ffb08141092805f93de5cafa2..8f7acd7619ac5dd5a31818df0a7d446dba58f802 100644 (file)
@@ -1,5 +1,7 @@
 // RUN: %clang_cc1 -triple x86_64-apple-darwin9 -fobjc-gc -g -emit-llvm -o - %s
 // RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-gc -g -emit-llvm -o - %s
+// RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin9 -fobjc-gc -g -emit-llvm -o - %s
+// RUN: %clang_cc1 -x objective-c++ -triple i386-apple-darwin9 -fobjc-gc -g -emit-llvm -o - %s
 
 // rdar://7252252
 @interface Loop {
index cfe1e95952fecfc8adda9748f578d59b0269f421..8c91a80b68635cf4eb3facd3789b7db13e536fd4 100644 (file)
@@ -1,4 +1,5 @@
 // RUN: %clang_cc1 -triple x86_64-apple-darwin9 -fobjc-gc -emit-llvm -o %t %s
+// RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin9 -fobjc-gc -emit-llvm -o %t %s
 @class NSObject;
 
 @interface Foo  {
index 9a76c6eb8208c2d5b72b7a993caa436dd13ae621..74cd7eafad4f1aa2b092e8709584fb64b7234d55 100644 (file)
@@ -2,6 +2,10 @@
 // RUN: grep -F '@objc_assign_global' %t  | count 7
 // RUN: grep -F '@objc_assign_ivar' %t  | count 5
 // RUN: grep -F '@objc_assign_strongCast' %t  | count 8
+// RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin10 -fobjc-gc -emit-llvm -o %t %s
+// RUN: grep -F '@objc_assign_global' %t  | count 7
+// RUN: grep -F '@objc_assign_ivar' %t  | count 5
+// RUN: grep -F '@objc_assign_strongCast' %t  | count 8
 
 extern id **somefunc(void);
 extern id *somefunc2(void);
index 626083b1c42d50676dcd6532b29ff19a70afedaa..cb72cc06e55cfeb003abd0db75e2fe3ab1f03ccc 100644 (file)
@@ -1,6 +1,9 @@
 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -fblocks -fobjc-gc -emit-llvm -o %t %s
 // RUN: grep objc_assign_ivar %t | count 3
 // RUN: grep objc_assign_strongCast %t | count 6
+// RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -fblocks -fobjc-gc -emit-llvm -o %t %s
+// RUN: grep objc_assign_ivar %t | count 3
+// RUN: grep objc_assign_strongCast %t | count 6
 
 struct Slice {
     void *__strong * items;
index 11b4ab4e96046430f2cf0185d1eec61428a207db..ab30649bec2be4943d8bd79a57e10e0a64a17bbf 100644 (file)
@@ -1,6 +1,9 @@
 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-gc -emit-llvm -o %t %s
 // RUN: grep objc_assign_global %t | count 3
 // RUN: grep objc_assign_strongCast %t | count 2
+// RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin10 -fobjc-gc -emit-llvm -o %t %s
+// RUN: grep objc_assign_global %t | count 3
+// RUN: grep objc_assign_strongCast %t | count 2
 
 @interface A
 @end
index babe26d55a53ef2c69923b0ecdce1c0f4fc8c6c4..373df0cc16b93749f5c31355e5413ee8a8b560db 100644 (file)
@@ -1,6 +1,9 @@
 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-gc -emit-llvm -o %t %s
 // RUN: grep objc_assign_ivar %t | count 0
 // RUN: grep objc_assign_strongCast %t | count 5
+// RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin10 -fobjc-gc -emit-llvm -o %t %s
+// RUN: grep objc_assign_ivar %t | count 0
+// RUN: grep objc_assign_strongCast %t | count 5
 
 @interface TestUnarchiver 
 {
index 0934e0a46ac30db1d226a5c74950de4e611d426a..08b65deaa38d062a52a12dc26076d8765e46eefb 100644 (file)
@@ -1,6 +1,9 @@
 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-gc -emit-llvm -o %t %s
 // RUN: grep -F '@objc_assign_global' %t  | count 21
 // RUN: grep -F '@objc_assign_ivar' %t  | count 11
+// RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin10 -fobjc-gc -emit-llvm -o %t %s
+// RUN: grep -F '@objc_assign_global' %t  | count 21
+// RUN: grep -F '@objc_assign_ivar' %t  | count 11
 
 
 typedef const struct __CFDictionary * CFDictionaryRef;
@@ -49,9 +52,9 @@ struct_with_ids_t GlobalStructArray[10];
 
 
 // The test cases
-void *rhs = 0;
+voidrhs = 0;
 
-#define ASSIGNTEST(expr, global) expr = rhs
+#define ASSIGNTEST(expr, global) expr = (typeof(expr))rhs
 
 int testGlobals() {
   // Everything in this function generates assign_global intercepts