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))
26 typedef NSInteger wibble;
29 UIViewAutoresizingNone = 0,
30 UIViewAutoresizingFlexibleLeftMargin,
31 UIViewAutoresizingFlexibleWidth,
32 UIViewAutoresizingFlexibleRightMargin,
33 UIViewAutoresizingFlexibleTopMargin,
34 UIViewAutoresizingFlexibleHeight,
35 UIViewAutoresizingFlexibleBottomMargin
37 typedef NSUInteger UITableViewCellStyle;
40 UIViewAnimationTransitionNone,
41 UIViewAnimationTransitionFlipFromLeft,
42 UIViewAnimationTransitionFlipFromRight,
43 UIViewAnimationTransitionCurlUp,
44 UIViewAnimationTransitionCurlDown,
45 } UIViewAnimationTransition;
77 // Should use NS_ENUM even though it is all power of 2.
82 typedef NSInteger UIK;
87 NSTickMarkLeft = NSTickMarkAbove,
88 NSTickMarkRight = NSTickMarkBelow
95 UIViewRightMargin = 0x3,
96 UIViewBottomMargin = 0xbadbeef
98 typedef NSInteger UITableStyle;
104 typedef NSInteger UIStyle;
114 typedef NSUInteger NSBitmapImageFileType;
117 NSWarningAlertStyle = 0,
118 NSInformationalAlertStyle = 1,
119 NSCriticalAlertStyle = 2
121 typedef NSUInteger NSAlertStyle;
131 typedef NSUInteger D_NSBitmapImageFileType DEPRECATED;
134 D_NSTickMarkBelow = 0,
135 D_NSTickMarkAbove = 1
136 } D_NSTickMarkPosition DEPRECATED;
139 #define NS_ENUM_AVAILABLE(X,Y)
142 NSFStrongMemory NS_ENUM_AVAILABLE(10_5, 6_0) = (0UL << 0),
143 NSFOpaqueMemory NS_ENUM_AVAILABLE(10_5, 6_0) = (2UL << 0),
144 NSFMallocMemory NS_ENUM_AVAILABLE(10_5, 6_0) = (3UL << 0),
145 NSFMachVirtualMemory NS_ENUM_AVAILABLE(10_5, 6_0) = (4UL << 0),
146 NSFWeakMemory NS_ENUM_AVAILABLE(10_8, 6_0) = (5UL << 0),
148 NSFObjectPersonality NS_ENUM_AVAILABLE(10_5, 6_0) = (0UL << 8),
149 NSFOpaquePersonality NS_ENUM_AVAILABLE(10_5, 6_0) = (1UL << 8),
150 NSFObjectPointerPersonality NS_ENUM_AVAILABLE(10_5, 6_0) = (2UL << 8),
151 NSFCStringPersonality NS_ENUM_AVAILABLE(10_5, 6_0) = (3UL << 8),
152 NSFStructPersonality NS_ENUM_AVAILABLE(10_5, 6_0) = (4UL << 8),
153 NSFIntegerPersonality NS_ENUM_AVAILABLE(10_5, 6_0) = (5UL << 8),
154 NSFCopyIn NS_ENUM_AVAILABLE(10_5, 6_0) = (1UL << 16),
157 typedef NSUInteger NSFOptions;
217 #define NS_AVAILABLE_MAC(X) __attribute__((availability(macosx,introduced=X)))
218 #define NS_ENUM_AVAILABLE_MAC(X) __attribute__((availability(macosx,introduced=X)))
221 NSModalResponseStop = (-1000), // Also used as the default response for sheets
222 NSModalResponseAbort = (-1001),
223 NSModalResponseContinue = (-1002),
224 } NS_ENUM_AVAILABLE_MAC(10.9);
225 typedef NSInteger NSModalResponse NS_AVAILABLE_MAC(10.9);
227 typedef NSUInteger FarFarAwayOptions;
229 typedef NSUInteger FarAwayOptions;
231 NSWorkspaceLaunchAndPrint = 0x00000002,
232 NSWorkspaceLaunchWithErrorPresentation = 0x00000040,
233 NSWorkspaceLaunchInhibitingBackgroundOnly = 0x00000080,
234 NSWorkspaceLaunchWithoutAddingToRecents = 0x00000100,
235 NSWorkspaceLaunchWithoutActivation = 0x00000200,
236 NSWorkspaceLaunchAsync = 0x00010000,
237 NSWorkspaceLaunchAllowingClassicStartup = 0x00020000,
238 NSWorkspaceLaunchPreferringClassic = 0x00040000,
239 NSWorkspaceLaunchNewInstance = 0x00080000,
240 NSWorkspaceLaunchAndHide = 0x00100000,
241 NSWorkspaceLaunchAndHideOthers = 0x00200000,
242 NSWorkspaceLaunchDefault = NSWorkspaceLaunchAsync |
243 NSWorkspaceLaunchAllowingClassicStartup
245 typedef NSUInteger NSWorkspaceLaunchOptions;
248 NSExcludeQuickDrawElementsIconCreationOption = 1 << 1,
249 NSExclude10_4ElementsIconCreationOption = 1 << 2
251 typedef NSUInteger NSExcludeOptions;
254 NSExcludeQuickDrawElementsCreationOption = 1 << 1,
255 NSExclude10_4ElementsCreationOption = 1 << 2
257 typedef NSUInteger NSExcludeCreationOption;
265 NSExcludeQuickDrawElementsIconOption = 1 << 1,
266 NSExclude10_4ElementsIconOption = 1 << 2
268 typedef NSUInteger NSExcludeIconOptions;
271 NSExcludeIconOptions I1;
272 NSExcludeIconOptions I2;
277 FarFarAway1 = 1 << 1,
281 typedef NS_OPTIONS(NSUInteger, NSWindowOcclusionState) {
282 NSWindowOcclusionStateVisible = 1UL << 1,
285 typedef NSUInteger NSWindowNumberListOptions;
288 NSDirectSelection = 0,
292 typedef NSUInteger NSSelectionDirection;
294 // standard window buttons
297 NSWindowMiniaturizeButton,
299 NSWindowToolbarButton,
300 NSWindowDocumentIconButton
303 typedef enum : NSUInteger {
332 typedef int8_t MyEnumeratedType;
341 typedef int16_t UI16;
344 UI32ViewAutoresizingNone = 0,
345 UI32ViewAutoresizingFlexibleLeftMargin,
346 UI32ViewAutoresizingFlexibleWidth,
347 UI32ViewAutoresizingFlexibleRightMargin,
348 UI32ViewAutoresizingFlexibleTopMargin,
349 UI32ViewAutoresizingFlexibleHeight,
350 UI32ViewAutoresizingFlexibleBottomMargin
352 typedef uint32_t UI32TableViewCellStyle;
358 typedef uint8_t UI8Type;
360 typedef enum : NSInteger {zero} MyEnum;
362 typedef enum : NSUInteger {two} MyEnumNSUInteger;
364 typedef enum : int {three, four} MyEnumint;
366 typedef enum : unsigned long {five} MyEnumlonglong;
368 typedef enum : unsigned long long {
373 } MyEnumunsignedlonglong;
375 typedef enum : int8_t {int8_one} MyOneEnum;
377 typedef enum : int16_t {
379 int16_t_two } Myint16_tEnum;