xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGenObjC/2007-05-02-Strong.m (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -S %s -fobjc-gc -o /dev/null
2*f4a2713aSLionel Sambuctypedef int NSInteger;
3*f4a2713aSLionel Sambuctypedef struct _NSRect {
4*f4a2713aSLionel Sambuc  int origin;
5*f4a2713aSLionel Sambuc  int size;
6*f4a2713aSLionel Sambuc} NSRect;
7*f4a2713aSLionel Sambuc
8*f4a2713aSLionel Sambuc__attribute__((objc_gc(strong))) NSRect *_cachedRectArray;
9*f4a2713aSLionel Sambucextern const NSRect NSZeroRect;
10*f4a2713aSLionel Sambuc@interface A{
11*f4a2713aSLionel Sambuc}
12*f4a2713aSLionel Sambuc-(void)bar:(NSInteger *)rectCount;
13*f4a2713aSLionel Sambuc@end
14*f4a2713aSLionel Sambuc
15*f4a2713aSLionel Sambuc@implementation A
16*f4a2713aSLionel Sambuc
17*f4a2713aSLionel Sambuc-(void)bar:(NSInteger *)rectCount {
18*f4a2713aSLionel Sambuc  NSRect appendRect = NSZeroRect;
19*f4a2713aSLionel Sambuc
20*f4a2713aSLionel Sambuc  _cachedRectArray[*rectCount - 1] = NSZeroRect;
21*f4a2713aSLionel Sambuc}
22*f4a2713aSLionel Sambuc
23*f4a2713aSLionel Sambuc@end
24