blob: b83857de7d7913ecc189abc69ed6f27461132456 [file] [log] [blame]
Fariborz Jahanian92463272013-07-18 20:11:45 +00001// RUN: rm -rf %t
Fariborz Jahanian8c45e282013-10-02 22:49:59 +00002// RUN: %clang_cc1 -objcmt-migrate-ns-macros -mt-migrate-directory %t %s -x objective-c -fobjc-runtime-has-weak -fobjc-arc -triple x86_64-apple-darwin11
Fariborz Jahanian92463272013-07-18 20:11:45 +00003// RUN: c-arcmt-test -mt-migrate-directory %t | arcmt-test -verify-transformed-files %s.result
Rafael Espindolaea1ba0a2013-09-27 20:21:48 +00004// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c -fobjc-runtime-has-weak -fobjc-arc %s.result
Fariborz Jahanian92463272013-07-18 20:11:45 +00005
6typedef long NSInteger;
Fariborz Jahanianb0057bb2013-07-19 01:05:49 +00007typedef unsigned long NSUInteger;
8
Fariborz Jahanian92463272013-07-18 20:11:45 +00009#define NS_ENUM(_type, _name) enum _name : _type _name; enum _name : _type
Fariborz Jahanianb0057bb2013-07-19 01:05:49 +000010#define NS_OPTIONS(_type, _name) enum _name : _type _name; enum _name : _type
Fariborz Jahanian75226d52013-09-17 21:56:04 +000011#define DEPRECATED __attribute__((deprecated))
Fariborz Jahanian92463272013-07-18 20:11:45 +000012
13enum {
14 blah,
15 blarg
16};
17typedef NSInteger wibble;
Fariborz Jahanianb0057bb2013-07-19 01:05:49 +000018
19enum {
20 UIViewAutoresizingNone = 0,
Fariborz Jahaniand0f6f792013-07-22 18:53:45 +000021 UIViewAutoresizingFlexibleLeftMargin,
22 UIViewAutoresizingFlexibleWidth,
23 UIViewAutoresizingFlexibleRightMargin,
24 UIViewAutoresizingFlexibleTopMargin,
25 UIViewAutoresizingFlexibleHeight,
26 UIViewAutoresizingFlexibleBottomMargin
Fariborz Jahanianb0057bb2013-07-19 01:05:49 +000027};
Fariborz Jahanianb0057bb2013-07-19 01:05:49 +000028typedef NSUInteger UITableViewCellStyle;
29
Fariborz Jahanianc1c44f62013-07-19 20:18:36 +000030typedef enum {
31 UIViewAnimationTransitionNone,
32 UIViewAnimationTransitionFlipFromLeft,
33 UIViewAnimationTransitionFlipFromRight,
34 UIViewAnimationTransitionCurlUp,
35 UIViewAnimationTransitionCurlDown,
36} UIViewAnimationTransition;
37
Fariborz Jahaniand0f6f792013-07-22 18:53:45 +000038typedef enum {
39 UIViewOne = 0,
40 UIViewTwo = 1 << 0,
41 UIViewThree = 1 << 1,
42 UIViewFour = 1 << 2,
43 UIViewFive = 1 << 3,
44 UIViewSix = 1 << 4,
45 UIViewSeven = 1 << 5
46} UITableView;
47
48enum {
49 UIOne = 0,
50 UITwo = 0x1,
51 UIthree = 0x8,
52 UIFour = 0x100
53};
54typedef NSInteger UI;
55
56typedef enum {
57 UIP2One = 0,
58 UIP2Two = 0x1,
59 UIP2three = 0x8,
60 UIP2Four = 0x100
61} UIPOWER2;
62
Fariborz Jahanian008ef722013-07-19 17:44:32 +000063enum {
64 UNOne,
65 UNTwo
66};
67
Fariborz Jahanianbe7bc112013-08-15 18:46:37 +000068// Should use NS_ENUM even though it is all power of 2.
69enum {
Fariborz Jahaniana23f4fb2013-08-30 00:10:37 +000070 UIKOne = 1,
71 UIKTwo = 2,
Fariborz Jahanianbe7bc112013-08-15 18:46:37 +000072};
73typedef NSInteger UIK;
Fariborz Jahanian313ae702013-08-15 19:27:42 +000074
75typedef enum {
76 NSTickMarkBelow = 0,
77 NSTickMarkAbove = 1,
78 NSTickMarkLeft = NSTickMarkAbove,
79 NSTickMarkRight = NSTickMarkBelow
80} NSTickMarkPosition;
Fariborz Jahaniana23f4fb2013-08-30 00:10:37 +000081
82enum {
83 UIViewNone = 0x0,
84 UIViewMargin = 0x1,
85 UIViewWidth = 0x2,
86 UIViewRightMargin = 0x3,
87 UIViewBottomMargin = 0xbadbeef
88};
89typedef NSInteger UITableStyle;
90
91enum {
92 UIView0 = 0,
93 UIView1 = 0XBADBEEF
94};
95typedef NSInteger UIStyle;
Fariborz Jahanianff3476e2013-08-30 17:46:01 +000096
97enum {
98 NSTIFFFileType,
99 NSBMPFileType,
100 NSGIFFileType,
101 NSJPEGFileType,
102 NSPNGFileType,
103 NSJPEG2000FileType
104};
105typedef NSUInteger NSBitmapImageFileType;
106
107enum {
108 NSWarningAlertStyle = 0,
109 NSInformationalAlertStyle = 1,
110 NSCriticalAlertStyle = 2
111};
112typedef NSUInteger NSAlertStyle;
113
Fariborz Jahanian75226d52013-09-17 21:56:04 +0000114enum {
115 D_NSTIFFFileType,
116 D_NSBMPFileType,
117 D_NSGIFFileType,
118 D_NSJPEGFileType,
119 D_NSPNGFileType,
120 D_NSJPEG2000FileType
121};
122typedef NSUInteger D_NSBitmapImageFileType DEPRECATED;
123
124typedef enum {
125 D_NSTickMarkBelow = 0,
126 D_NSTickMarkAbove = 1
127} D_NSTickMarkPosition DEPRECATED;
128
Fariborz Jahanian6e1798e2013-09-17 23:32:51 +0000129
130#define NS_ENUM_AVAILABLE(X,Y)
131
132enum {
133 NSFStrongMemory NS_ENUM_AVAILABLE(10_5, 6_0) = (0UL << 0),
134 NSFOpaqueMemory NS_ENUM_AVAILABLE(10_5, 6_0) = (2UL << 0),
135 NSFMallocMemory NS_ENUM_AVAILABLE(10_5, 6_0) = (3UL << 0),
136 NSFMachVirtualMemory NS_ENUM_AVAILABLE(10_5, 6_0) = (4UL << 0),
137 NSFWeakMemory NS_ENUM_AVAILABLE(10_8, 6_0) = (5UL << 0),
138
139 NSFObjectPersonality NS_ENUM_AVAILABLE(10_5, 6_0) = (0UL << 8),
140 NSFOpaquePersonality NS_ENUM_AVAILABLE(10_5, 6_0) = (1UL << 8),
141 NSFObjectPointerPersonality NS_ENUM_AVAILABLE(10_5, 6_0) = (2UL << 8),
142 NSFCStringPersonality NS_ENUM_AVAILABLE(10_5, 6_0) = (3UL << 8),
143 NSFStructPersonality NS_ENUM_AVAILABLE(10_5, 6_0) = (4UL << 8),
144 NSFIntegerPersonality NS_ENUM_AVAILABLE(10_5, 6_0) = (5UL << 8),
145 NSFCopyIn NS_ENUM_AVAILABLE(10_5, 6_0) = (1UL << 16),
146};
147
148typedef NSUInteger NSFOptions;
Fariborz Jahanian02bdb162013-09-23 20:27:06 +0000149
150typedef enum {
151 UIP0One = 0,
152 UIP0Two = 1,
153 UIP0Three = 2,
154 UIP0Four = 10,
155 UIP0Last = 0x100
156} UIP;
157
158typedef enum {
159 UIPZero = 0x0,
160 UIPOne = 0x1,
161 UIPTwo = 0x2,
162 UIP10 = 0x10,
163 UIPHundred = 0x100
164} UIP_3;
165
166typedef enum {
167 UIP4Zero = 0x0,
168 UIP4One = 0x1,
169 UIP4Two = 0x2,
170 UIP410 = 0x10,
171 UIP4Hundred = 100
172} UIP4_3;
173
174typedef enum {
175 UIP5Zero = 0x0,
176 UIP5Two = 0x2,
177 UIP510 = 0x3,
178 UIP5Hundred = 0x4
179} UIP5_3;
180
181typedef enum {
182 UIP6Zero = 0x0,
183 UIP6One = 0x1,
184 UIP6Two = 0x2,
185 UIP610 = 10,
186 UIP6Hundred = 0x100
187} UIP6_3;
188
189typedef enum {
190 UIP7Zero = 0x0,
191 UIP7One = 1,
192 UIP7Two = 0x2,
193 UIP710 = 10,
194 UIP7Hundred = 100
195} UIP7_3;
196
197
198typedef enum {
199 Random = 0,
200 Random1 = 2,
201 Random2 = 4,
202 Random3 = 0x12345,
203 Random4 = 0x3444444,
204 Random5 = 0xbadbeef,
205 Random6
206} UIP8_3;
Fariborz Jahanian1d27ffd2013-10-11 17:35:22 +0000207
208// rdar://15200602
209#define NS_AVAILABLE_MAC(X) __attribute__((availability(macosx,introduced=X)))
210#define NS_ENUM_AVAILABLE_MAC(X) __attribute__((availability(macosx,introduced=X)))
211
212enum {
213 NSModalResponseStop = (-1000), // Also used as the default response for sheets
214 NSModalResponseAbort = (-1001),
215 NSModalResponseContinue = (-1002),
216} NS_ENUM_AVAILABLE_MAC(10.9);
217typedef NSInteger NSModalResponse NS_AVAILABLE_MAC(10.9);