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;
218 #define NS_AVAILABLE_MAC(X) __attribute__((availability(macosx,introduced=X)))
219 #define NS_ENUM_AVAILABLE_MAC(X) __attribute__((availability(macosx,introduced=X)))
222 NSModalResponseStop = (-1000), // Also used as the default response for sheets
223 NSModalResponseAbort = (-1001),
224 NSModalResponseContinue = (-1002),
225 } NS_ENUM_AVAILABLE_MAC(10.9);
226 typedef NSInteger NSModalResponse NS_AVAILABLE_MAC(10.9);
229 typedef NSUInteger FarFarAwayOptions;
232 typedef NSUInteger FarAwayOptions;
234 NSWorkspaceLaunchAndPrint = 0x00000002,
235 NSWorkspaceLaunchWithErrorPresentation = 0x00000040,
236 NSWorkspaceLaunchInhibitingBackgroundOnly = 0x00000080,
237 NSWorkspaceLaunchWithoutAddingToRecents = 0x00000100,
238 NSWorkspaceLaunchWithoutActivation = 0x00000200,
239 NSWorkspaceLaunchAsync = 0x00010000,
240 NSWorkspaceLaunchAllowingClassicStartup = 0x00020000,
241 NSWorkspaceLaunchPreferringClassic = 0x00040000,
242 NSWorkspaceLaunchNewInstance = 0x00080000,
243 NSWorkspaceLaunchAndHide = 0x00100000,
244 NSWorkspaceLaunchAndHideOthers = 0x00200000,
245 NSWorkspaceLaunchDefault = NSWorkspaceLaunchAsync |
246 NSWorkspaceLaunchAllowingClassicStartup
248 typedef NSUInteger NSWorkspaceLaunchOptions;
251 NSExcludeQuickDrawElementsIconCreationOption = 1 << 1,
252 NSExclude10_4ElementsIconCreationOption = 1 << 2
254 typedef NSUInteger NSExcludeOptions;
257 NSExcludeQuickDrawElementsCreationOption = 1 << 1,
258 NSExclude10_4ElementsCreationOption = 1 << 2
260 typedef NSUInteger NSExcludeCreationOption;
268 NSExcludeQuickDrawElementsIconOption = 1 << 1,
269 NSExclude10_4ElementsIconOption = 1 << 2
271 typedef NSUInteger NSExcludeIconOptions;
274 NSExcludeIconOptions I1;
275 NSExcludeIconOptions I2;
280 FarFarAway1 = 1 << 1,
285 typedef NS_OPTIONS(NSUInteger, NSWindowOcclusionState) {
286 NSWindowOcclusionStateVisible = 1UL << 1,
289 typedef NSUInteger NSWindowNumberListOptions;
292 NSDirectSelection = 0,
296 typedef NSUInteger NSSelectionDirection;
298 // standard window buttons
301 NSWindowMiniaturizeButton,
303 NSWindowToolbarButton,
304 NSWindowDocumentIconButton
308 typedef enum : NSUInteger {
339 typedef int8_t MyEnumeratedType;
348 typedef int16_t UI16;
351 UI32ViewAutoresizingNone = 0,
352 UI32ViewAutoresizingFlexibleLeftMargin,
353 UI32ViewAutoresizingFlexibleWidth,
354 UI32ViewAutoresizingFlexibleRightMargin,
355 UI32ViewAutoresizingFlexibleTopMargin,
356 UI32ViewAutoresizingFlexibleHeight,
357 UI32ViewAutoresizingFlexibleBottomMargin
359 typedef uint32_t UI32TableViewCellStyle;
365 typedef uint8_t UI8Type;
368 typedef enum : NSInteger {zero} MyEnum;
370 typedef enum : NSUInteger {two} MyEnumNSUInteger;
372 typedef enum : int {three, four} MyEnumint;
374 typedef enum : unsigned long {five} MyEnumlonglong;
376 typedef enum : unsigned long long {
381 } MyEnumunsignedlonglong;
384 typedef enum : int8_t {int8_one} MyOneEnum;
386 typedef enum : int16_t {
388 int16_t_two } Myint16_tEnum;