1 /* Test instance variable scope. */
2 /* Author: Dimitris Papavasiliou <dpapavas@gmail.com>. */
4 /* { dg-additional-options "-Wno-shadow-ivar -fno-local-ivars" } */
5 #include "../objc-obj-c++-shared/runtime.h"
8 extern void abort(void);
12 /* The testsuite object depends on local variable scope so we need to
13 implement our own minimal base object here. */
28 @implementation MyClass
31 return class_createInstance (self, 0);
48 return self->someivar;
63 object = [[MyClass alloc] init];
65 /* Check for aliasing between instance variable and global
68 if ([object getGlobal] != 1) {
72 if ([object getInstance] != 2) {
76 /* Check whether the local variable hides the instance variable. */
78 if ([object getHidden] != 3) {