diff options
Diffstat (limited to 'test/Driver/darwin-objc-gc.m')
-rw-r--r-- | test/Driver/darwin-objc-gc.m | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/Driver/darwin-objc-gc.m b/test/Driver/darwin-objc-gc.m new file mode 100644 index 0000000..aecb9a6 --- /dev/null +++ b/test/Driver/darwin-objc-gc.m @@ -0,0 +1,19 @@ +// Check that we warn, but accept, -fobjc-gc for iPhone OS. + +// RUN: %clang -ccc-host-triple i386-apple-darwin9 -miphoneos-version-min=3.0 -fobjc-gc -flto -S -o %t %s 2> %t.err +// RUN: FileCheck --check-prefix=IPHONE_OBJC_GC_LL %s < %t +// RUN: FileCheck --check-prefix=IPHONE_OBJC_GC_STDERR %s < %t.err + +// IPHONE_OBJC_GC_LL: define void @f0 +// IPHONE_OBJC_GC_LL-NOT: objc_assign_ivar +// IPHONE_OBJC_GC_LL: } + +// IPHONE_OBJC_GC_STDERR: warning: Objective-C garbage collection is not supported on this platform, ignoring '-fobjc-gc' + +@interface A { +@public + id x; +} +@end + +void f0(A *a, id x) { a->x = x; } |