xref: /minix3/external/bsd/llvm/dist/clang/test/Rewriter/rewrite-anonymous-union.m (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -rewrite-objc -fobjc-runtime=macosx-fragile-10.5  -o - %s
2*f4a2713aSLionel Sambuc// rdar://6948022
3*f4a2713aSLionel Sambuc
4*f4a2713aSLionel Sambuctypedef unsigned int uint32_t;
5*f4a2713aSLionel Sambuc
6*f4a2713aSLionel Sambuctypedef struct {
7*f4a2713aSLionel Sambuc    union {
8*f4a2713aSLionel Sambuc        uint32_t daysOfWeek;
9*f4a2713aSLionel Sambuc        uint32_t dayOfMonth;
10*f4a2713aSLionel Sambuc    };
11*f4a2713aSLionel Sambuc    uint32_t nthOccurrence;
12*f4a2713aSLionel Sambuc} OSPatternSpecificData;
13*f4a2713aSLionel Sambuc
14*f4a2713aSLionel Sambuc@interface NSNumber
15*f4a2713aSLionel Sambuc+ (NSNumber *)numberWithLong:(long)value;
16*f4a2713aSLionel Sambuc@end
17*f4a2713aSLionel Sambuc
18*f4a2713aSLionel Sambuc@interface OSRecurrence  {
19*f4a2713aSLionel Sambuc    OSPatternSpecificData _pts;
20*f4a2713aSLionel Sambuc}
21*f4a2713aSLionel Sambuc- (void)_setTypeSpecificInfoOnRecord;
22*f4a2713aSLionel Sambuc@end
23*f4a2713aSLionel Sambuc
24*f4a2713aSLionel Sambuc@implementation OSRecurrence
25*f4a2713aSLionel Sambuc- (void)_setTypeSpecificInfoOnRecord
26*f4a2713aSLionel Sambuc{
27*f4a2713aSLionel Sambuc    [NSNumber numberWithLong:(_pts.dayOfMonth >= 31 ? -1 : _pts.dayOfMonth)];
28*f4a2713aSLionel Sambuc}
29*f4a2713aSLionel Sambuc@end
30*f4a2713aSLionel Sambuc
31