From 222e2a7620e6520ffaf4fc4e69d79c18da31542e Mon Sep 17 00:00:00 2001 From: "Zancanaro; Carlo" Date: Mon, 24 Sep 2012 09:58:17 +1000 Subject: Add the clang library to the repo (with some of my changes, too). --- clang/test/Driver/darwin-objc-gc.m | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 clang/test/Driver/darwin-objc-gc.m (limited to 'clang/test/Driver/darwin-objc-gc.m') diff --git a/clang/test/Driver/darwin-objc-gc.m b/clang/test/Driver/darwin-objc-gc.m new file mode 100644 index 0000000..06e3aea --- /dev/null +++ b/clang/test/Driver/darwin-objc-gc.m @@ -0,0 +1,19 @@ +// Check that we warn, but accept, -fobjc-gc for iPhone OS. + +// RUN: %clang -target 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; } -- cgit v1.2.3