diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2012-01-25 00:20:29 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2012-01-25 00:20:29 +0000 |
commit | b5c6babd3d8e0233b8ea5a4eb1e2700e30c0d396 (patch) | |
tree | e5deec788a11cba4e6a7d0f20be47bb4c436d04e /test/ARCMT | |
parent | 44fae525e792f09ecbe07c0a62cdbcb81e04306b (diff) |
arc migrator: Provide infrastructure to add options
specific to migrator. Use its first option to
warn migrating from GC to arc when
NSAllocateCollectable/NSReallocateCollectable is used.
// rdar://10532541
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148887 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/ARCMT')
-rw-r--r-- | test/ARCMT/GC-check-warn-nsalloc.m | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/ARCMT/GC-check-warn-nsalloc.m b/test/ARCMT/GC-check-warn-nsalloc.m new file mode 100644 index 0000000000..5ce36c40d6 --- /dev/null +++ b/test/ARCMT/GC-check-warn-nsalloc.m @@ -0,0 +1,12 @@ +// RUN: %clang_cc1 -arcmt-check -verify -no-ns-alloc-error -triple x86_64-apple-darwin10 -fobjc-gc-only %s +// RUN: %clang_cc1 -arcmt-check -verify -no-ns-alloc-error -triple x86_64-apple-darwin10 -fobjc-gc-only -x objective-c++ %s +// DISABLE: mingw32 +// rdar://10532541 +// XFAIL: * + +typedef unsigned NSUInteger; +void *__strong NSAllocateCollectable(NSUInteger size, NSUInteger options); + +void test1() { + NSAllocateCollectable(100, 0); // expected-warning {{call returns pointer to GC managed memory; it will become unmanaged in ARC}} +} |