1//===-- main.m ------------------------------------------*- Objective-C -*-===// 2// 3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4// See https://llvm.org/LICENSE.txt for license information. 5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6// 7//===----------------------------------------------------------------------===// 8 9#import <Foundation/Foundation.h> 10 11@interface A : NSObject 12{ 13 int m_a; 14} 15-(id)init; 16-(void)accessMember:(int)a; 17+(void)accessStaticMember:(int)a; 18@end 19 20static int s_a = 5; 21 22@implementation A 23-(id)init 24{ 25 self = [super init]; 26 27 if (self) 28 m_a = 2; 29 30 return self; 31} 32 33-(void)accessMember:(int)a 34{ 35 m_a = a; // breakpoint 1 36} 37 38+(void)accessStaticMember:(int)a 39{ 40 s_a = a; // breakpoint 2 41} 42@end 43 44int main() 45{ 46 NSAutoreleasePool *pool = [NSAutoreleasePool alloc]; 47 A *my_a = [[A alloc] init]; 48 49 [my_a accessMember:3]; 50 [A accessStaticMember:5]; 51 52 [pool release]; 53} 54