Daily bump.
[official-gcc.git] / gcc / testsuite / objc.dg / ivar-scope-1.m
blob64d275b44bd12c29d132cea525c87d5f8c750266
1 /* Test instance variable scope.  */
2 /* Author: Dimitris Papavasiliou <dpapavas@gmail.com>.  */
3 /* { dg-do compile } */
4 #include <objc/objc.h>
6 #if defined(__has_attribute) && __has_attribute(objc_root_class)
7 __attribute__((objc_root_class))
8 #endif
9 @interface MyClass
11   int someivar;
13 - (void) test;
14 @end
16 @implementation MyClass
17 - (void) test
19   int a;
21   /* Make sure instance variables do have local scope when
22      -fno-local-ivar isn't specified. */
23   
24   a = self->someivar;  /* No warning or error. */
25   a = someivar;        /* No error. */
27 @end