aboutsummaryrefslogtreecommitdiff
path: root/clang/test/Rewriter/rewrite-anonymous-union.m
blob: b5b1aa4f1f5705556b7582135041a611d9d1f6c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// RUN: %clang_cc1 -rewrite-objc -fobjc-runtime=macosx-fragile-10.5  -o - %s

typedef unsigned int uint32_t;

typedef struct {
    union {
        uint32_t daysOfWeek;
        uint32_t dayOfMonth;
    };
    uint32_t nthOccurrence;
} OSPatternSpecificData;

@interface NSNumber
+ (NSNumber *)numberWithLong:(long)value;
@end

@interface OSRecurrence  {
    OSPatternSpecificData _pts;
}
- (void)_setTypeSpecificInfoOnRecord;
@end

@implementation OSRecurrence
- (void)_setTypeSpecificInfoOnRecord
{
    [NSNumber numberWithLong:(_pts.dayOfMonth >= 31 ? -1 : _pts.dayOfMonth)];
}
@end