1 /* Test instance variable scope. */
2 /* Author: Dimitris Papavasiliou <dpapavas@gmail.com>. */
4 /* { dg-additional-options "-Wno-shadow-ivar -fno-local-ivars -Wno-objc-root-class" } */
6 #include "../objc-obj-c++-shared/runtime.h"
9 extern void abort(void);
13 /* The testsuite object depends on local variable scope so we need to
14 implement our own minimal base object here. */
30 @implementation MyClass
38 return class_createInstance (self, 0);
55 return self->someivar;
70 object = [[MyClass alloc] init];
72 /* Check for aliasing between instance variable and global
75 if ([object getGlobal] != 1) {
79 if ([object getInstance] != 2) {
83 /* Check whether the local variable hides the instance variable. */
85 if ([object getHidden] != 3) {