From 1bc5aee63eb72b341f506ad058502cd0361f0d10 Mon Sep 17 00:00:00 2001 From: Ben Cheng Date: Tue, 25 Mar 2014 22:37:19 -0700 Subject: Initial checkin of GCC 4.9.0 from trunk (r208799). Change-Id: I48a3c08bb98542aa215912a75f03c0890e497dba --- .../gcc/testsuite/objc.dg/property/at-property-6.m | 61 ++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 gcc-4.9/gcc/testsuite/objc.dg/property/at-property-6.m (limited to 'gcc-4.9/gcc/testsuite/objc.dg/property/at-property-6.m') diff --git a/gcc-4.9/gcc/testsuite/objc.dg/property/at-property-6.m b/gcc-4.9/gcc/testsuite/objc.dg/property/at-property-6.m new file mode 100644 index 000000000..b3584cc40 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/objc.dg/property/at-property-6.m @@ -0,0 +1,61 @@ +/* Contributed by Nicola Pero , October 2010. */ +/* { dg-do run } */ +/* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */ + +/* Test the property syntax with non-synthesized setter/getter + and with standard names. */ + +#include +#include +#include + +@interface MyRootClass +{ + Class isa; + int a; +} +@property (nonatomic) int a; ++ (id) initialize; ++ (id) alloc; +- (id) init; +@end + +@implementation MyRootClass ++ (id) initialize { return self; } ++ (id) alloc { return class_createInstance (self, 0); } +- (id) init { return self; } + +- (int) a +{ + return a; +} +- (void) setA: (int)value +{ + a = value; +} +@end + +int main (void) +{ + MyRootClass *object = [[MyRootClass alloc] init]; + + if (object.a != 0) + abort (); + + object.a = 14; + + if (object.a != 14) + abort (); + + object.a = 23; + + if (object.a != 23) + abort (); + + object.a = 78; + + if (object.a != 78) + abort (); + + return 0; +} -- cgit v1.2.3