mirror of https://github.com/microsoft/clang.git
More Objective-C++ GC tests.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104253 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
c673af7fe6
commit
27b7aa004a
|
@ -1,9 +1,11 @@
|
||||||
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fblocks -fobjc-gc -emit-llvm -o %t %s
|
// 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: 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
|
@interface DSATextSearch @end
|
||||||
|
|
||||||
DSATextSearch **_uniqueIdToIdentifierArray = ((void *)0);
|
DSATextSearch **_uniqueIdToIdentifierArray = (0);
|
||||||
void foo (int _nextId)
|
void foo (int _nextId)
|
||||||
{
|
{
|
||||||
_uniqueIdToIdentifierArray[_nextId] = 0; // objc_assign_strongCast
|
_uniqueIdToIdentifierArray[_nextId] = 0; // objc_assign_strongCast
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -fobjc-gc -emit-llvm -o %t %s
|
// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -fobjc-gc -emit-llvm -o %t %s
|
||||||
// RUN: grep 'objc_assign' %t | count 0
|
// 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 {
|
typedef struct {
|
||||||
int ival;
|
int ival;
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -fobjc-gc-only -emit-llvm -o %t %s
|
// 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 {
|
@interface I0 {
|
||||||
I0 *_f0;
|
I0 *_f0;
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -fobjc-gc -emit-llvm -o %t %s
|
// 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 {
|
@interface I {
|
||||||
__attribute__((objc_gc(strong))) int *i_IdocumentIDs;
|
__attribute__((objc_gc(strong))) int *i_IdocumentIDs;
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
// RUN: %clang_cc1 -fobjc-gc -emit-llvm -o %t %s
|
// 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 {
|
@interface I {
|
||||||
__attribute__((objc_gc(strong))) signed long *_documentIDs;
|
__attribute__((objc_gc(strong))) signed long *_documentIDs;
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -fobjc-gc -emit-llvm -o %t %s
|
// 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: 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;
|
__weak id* x;
|
||||||
id* __weak y;
|
id* __weak y;
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-gc -emit-llvm -o %t %s
|
// 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
|
@interface PBXTarget
|
||||||
{
|
{
|
||||||
|
@ -10,6 +11,7 @@ PBXTarget * result;
|
||||||
- Meth;
|
- Meth;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
extern void foo();
|
||||||
@implementation PBXTarget
|
@implementation PBXTarget
|
||||||
- Meth {
|
- Meth {
|
||||||
if (_lastKnownTarget != result)
|
if (_lastKnownTarget != result)
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -fobjc-gc -g -emit-llvm -o - %s
|
// 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 -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
|
// rdar://7252252
|
||||||
@interface Loop {
|
@interface Loop {
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -fobjc-gc -emit-llvm -o %t %s
|
// 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;
|
@class NSObject;
|
||||||
|
|
||||||
@interface Foo {
|
@interface Foo {
|
||||||
|
|
|
@ -2,6 +2,10 @@
|
||||||
// RUN: grep -F '@objc_assign_global' %t | count 7
|
// RUN: grep -F '@objc_assign_global' %t | count 7
|
||||||
// RUN: grep -F '@objc_assign_ivar' %t | count 5
|
// RUN: grep -F '@objc_assign_ivar' %t | count 5
|
||||||
// RUN: grep -F '@objc_assign_strongCast' %t | count 8
|
// 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 **somefunc(void);
|
||||||
extern id *somefunc2(void);
|
extern id *somefunc2(void);
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -fblocks -fobjc-gc -emit-llvm -o %t %s
|
// 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_ivar %t | count 3
|
||||||
// RUN: grep objc_assign_strongCast %t | count 6
|
// 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 {
|
struct Slice {
|
||||||
void *__strong * items;
|
void *__strong * items;
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-gc -emit-llvm -o %t %s
|
// 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_global %t | count 3
|
||||||
// RUN: grep objc_assign_strongCast %t | count 2
|
// 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
|
@interface A
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-gc -emit-llvm -o %t %s
|
// 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_ivar %t | count 0
|
||||||
// RUN: grep objc_assign_strongCast %t | count 5
|
// 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
|
@interface TestUnarchiver
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-gc -emit-llvm -o %t %s
|
// 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_global' %t | count 21
|
||||||
// RUN: grep -F '@objc_assign_ivar' %t | count 11
|
// 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;
|
typedef const struct __CFDictionary * CFDictionaryRef;
|
||||||
|
@ -51,7 +54,7 @@ struct_with_ids_t GlobalStructArray[10];
|
||||||
// The test cases
|
// The test cases
|
||||||
void* rhs = 0;
|
void* rhs = 0;
|
||||||
|
|
||||||
#define ASSIGNTEST(expr, global) expr = rhs
|
#define ASSIGNTEST(expr, global) expr = (typeof(expr))rhs
|
||||||
|
|
||||||
int testGlobals() {
|
int testGlobals() {
|
||||||
// Everything in this function generates assign_global intercepts
|
// Everything in this function generates assign_global intercepts
|
||||||
|
|
Loading…
Reference in New Issue