2 // 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
3 // RUN: c-arcmt-test -mt-migrate-directory %t | arcmt-test -verify-transformed-files %s.result
4 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c -fobjc-runtime-has-weak -fobjc-arc %s.result
6 typedef signed char int8_t;
9 typedef long NSInteger;
10 typedef long long int64_t;
12 typedef unsigned char uint8_t;
13 typedef unsigned short uint16_t;
14 typedef unsigned int uint32_t;
15 typedef unsigned long NSUInteger;
16 typedef unsigned long long uint64_t;
18 #define NS_ENUM(_type, _name) enum _name : _type _name; enum _name : _type
19 #define NS_OPTIONS(_type, _name) enum _name : _type _name; enum _name : _type
20 #define DEPRECATED __attribute__((deprecated))
22 typedef NS_ENUM(NSInteger, wibble) {
27 typedef NS_ENUM(NSUInteger, UITableViewCellStyle) {
28 UIViewAutoresizingNone = 0,
29 UIViewAutoresizingFlexibleLeftMargin,
30 UIViewAutoresizingFlexibleWidth,
31 UIViewAutoresizingFlexibleRightMargin,
32 UIViewAutoresizingFlexibleTopMargin,
33 UIViewAutoresizingFlexibleHeight,
34 UIViewAutoresizingFlexibleBottomMargin
37 typedef NS_ENUM(unsigned int, UIViewAnimationTransition) {
38 UIViewAnimationTransitionNone,
39 UIViewAnimationTransitionFlipFromLeft,
40 UIViewAnimationTransitionFlipFromRight,
41 UIViewAnimationTransitionCurlUp,
42 UIViewAnimationTransitionCurlDown,
45 typedef NS_OPTIONS(unsigned int, UITableView) {
55 typedef NS_OPTIONS(NSUInteger, UI) {
62 typedef NS_OPTIONS(unsigned int, UIPOWER2) {
74 // Should use NS_ENUM even though it is all power of 2.
75 typedef NS_ENUM(NSInteger, UIK) {
80 typedef NS_ENUM(unsigned int, NSTickMarkPosition) {
83 NSTickMarkLeft = NSTickMarkAbove,
84 NSTickMarkRight = NSTickMarkBelow
87 typedef NS_OPTIONS(NSUInteger, UITableStyle) {
91 UIViewRightMargin = 0x3,
92 UIViewBottomMargin = 0xbadbeef
95 typedef NS_OPTIONS(NSUInteger, UIStyle) {
100 typedef NS_ENUM(NSUInteger, NSBitmapImageFileType) {
109 typedef NS_ENUM(NSUInteger, NSAlertStyle) {
110 NSWarningAlertStyle = 0,
111 NSInformationalAlertStyle = 1,
112 NSCriticalAlertStyle = 2
123 typedef NSUInteger D_NSBitmapImageFileType DEPRECATED;
126 D_NSTickMarkBelow = 0,
127 D_NSTickMarkAbove = 1
128 } D_NSTickMarkPosition DEPRECATED;
131 #define NS_ENUM_AVAILABLE(X,Y)
134 typedef NS_OPTIONS(NSUInteger, NSFOptions) {
135 NSFStrongMemory NS_ENUM_AVAILABLE(10_5, 6_0) = (0UL << 0),
136 NSFOpaqueMemory NS_ENUM_AVAILABLE(10_5, 6_0) = (2UL << 0),
137 NSFMallocMemory NS_ENUM_AVAILABLE(10_5, 6_0) = (3UL << 0),
138 NSFMachVirtualMemory NS_ENUM_AVAILABLE(10_5, 6_0) = (4UL << 0),
139 NSFWeakMemory NS_ENUM_AVAILABLE(10_8, 6_0) = (5UL << 0),
141 NSFObjectPersonality NS_ENUM_AVAILABLE(10_5, 6_0) = (0UL << 8),
142 NSFOpaquePersonality NS_ENUM_AVAILABLE(10_5, 6_0) = (1UL << 8),
143 NSFObjectPointerPersonality NS_ENUM_AVAILABLE(10_5, 6_0) = (2UL << 8),
144 NSFCStringPersonality NS_ENUM_AVAILABLE(10_5, 6_0) = (3UL << 8),
145 NSFStructPersonality NS_ENUM_AVAILABLE(10_5, 6_0) = (4UL << 8),
146 NSFIntegerPersonality NS_ENUM_AVAILABLE(10_5, 6_0) = (5UL << 8),
147 NSFCopyIn NS_ENUM_AVAILABLE(10_5, 6_0) = (1UL << 16),
150 typedef NS_ENUM(unsigned int, UIP) {
158 typedef NS_OPTIONS(unsigned int, UIP_3) {
166 typedef NS_ENUM(unsigned int, UIP4_3) {
174 typedef NS_OPTIONS(unsigned int, UIP5_3) {
181 typedef NS_ENUM(unsigned int, UIP6_3) {
189 typedef NS_ENUM(unsigned int, UIP7_3) {
198 typedef NS_ENUM(unsigned int, UIP8_3) {
208 #define NS_AVAILABLE_MAC(X) __attribute__((availability(macosx,introduced=X)))
209 #define NS_ENUM_AVAILABLE_MAC(X) __attribute__((availability(macosx,introduced=X)))
211 typedef NS_ENUM(NSInteger, NSModalResponse) {
212 NSModalResponseStop = (-1000), // Also used as the default response for sheets
213 NSModalResponseAbort = (-1001),
214 NSModalResponseContinue = (-1002),
215 } NS_ENUM_AVAILABLE_MAC(10.9);
217 typedef NSUInteger FarFarAwayOptions;
219 typedef NS_OPTIONS(NSUInteger, FarAwayOptions) {
223 typedef NS_OPTIONS(NSUInteger, NSWorkspaceLaunchOptions) {
224 NSWorkspaceLaunchAndPrint = 0x00000002,
225 NSWorkspaceLaunchWithErrorPresentation = 0x00000040,
226 NSWorkspaceLaunchInhibitingBackgroundOnly = 0x00000080,
227 NSWorkspaceLaunchWithoutAddingToRecents = 0x00000100,
228 NSWorkspaceLaunchWithoutActivation = 0x00000200,
229 NSWorkspaceLaunchAsync = 0x00010000,
230 NSWorkspaceLaunchAllowingClassicStartup = 0x00020000,
231 NSWorkspaceLaunchPreferringClassic = 0x00040000,
232 NSWorkspaceLaunchNewInstance = 0x00080000,
233 NSWorkspaceLaunchAndHide = 0x00100000,
234 NSWorkspaceLaunchAndHideOthers = 0x00200000,
235 NSWorkspaceLaunchDefault = NSWorkspaceLaunchAsync |
236 NSWorkspaceLaunchAllowingClassicStartup
239 typedef NS_OPTIONS(NSUInteger, NSExcludeOptions) {
240 NSExcludeQuickDrawElementsIconCreationOption = 1 << 1,
241 NSExclude10_4ElementsIconCreationOption = 1 << 2
244 typedef NS_OPTIONS(NSUInteger, NSExcludeCreationOption) {
245 NSExcludeQuickDrawElementsCreationOption = 1 << 1,
246 NSExclude10_4ElementsCreationOption = 1 << 2
250 typedef NS_OPTIONS(NSUInteger, NSExcludeIconOptions) {
251 NSExcludeQuickDrawElementsIconOption = 1 << 1,
252 NSExclude10_4ElementsIconOption = 1 << 2
256 NSExcludeIconOptions I1;
257 NSExcludeIconOptions I2;
262 FarFarAway1 = 1 << 1,
266 typedef NS_OPTIONS(NSUInteger, NSWindowOcclusionState) {
267 NSWindowOcclusionStateVisible = 1UL << 1,
270 typedef NS_ENUM(NSUInteger, NSWindowNumberListOptions) {
272 NSWindowMiniaturizeButton,
274 NSWindowToolbarButton,
275 NSWindowDocumentIconButton
278 typedef NS_ENUM(NSUInteger, NSSelectionDirection) {
279 NSDirectSelection = 0,
284 // standard window buttons
286 typedef NS_ENUM(NSUInteger, Thing) {
292 typedef NS_ENUM(unsigned int, NumericEnum) {
296 typedef NS_ENUM(unsigned int, NumericEnum2) {
300 typedef NS_ENUM(unsigned int, NumericEnum3) {
304 typedef NS_OPTIONS(unsigned int, NumericEnum4) {
308 typedef NS_ENUM(int8_t, MyEnumeratedType)
314 typedef NS_OPTIONS(uint16_t, UI16) {
321 typedef NS_ENUM(uint32_t, UI32TableViewCellStyle) {
322 UI32ViewAutoresizingNone = 0,
323 UI32ViewAutoresizingFlexibleLeftMargin,
324 UI32ViewAutoresizingFlexibleWidth,
325 UI32ViewAutoresizingFlexibleRightMargin,
326 UI32ViewAutoresizingFlexibleTopMargin,
327 UI32ViewAutoresizingFlexibleHeight,
328 UI32ViewAutoresizingFlexibleBottomMargin
331 typedef NS_ENUM(uint8_t, UI8Type)
336 typedef NS_ENUM(NSInteger, MyEnum) {zero};
338 typedef NS_ENUM(NSUInteger, MyEnumNSUInteger) {two};
340 typedef NS_ENUM(int, MyEnumint) {three, four};
342 typedef NS_ENUM(unsigned long, MyEnumlonglong) {five};
344 typedef NS_ENUM(unsigned long long, MyEnumunsignedlonglong) {
351 typedef NS_ENUM(int8_t, MyOneEnum) {int8_one};
353 typedef NS_ENUM(int16_t, Myint16_tEnum) {