blob: edc3ffd40439a75b8a73e0971d12bf60fe7539fe [file] [log] [blame]
Fariborz Jahanian92463272013-07-18 20:11:45 +00001// RUN: rm -rf %t
2// RUN: %clang_cc1 -objcmt-migrate-property -mt-migrate-directory %t %s -x objective-c -fobjc-runtime-has-weak -fobjc-arc -fobjc-default-synthesize-properties -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 -fobjc-default-synthesize-properties %s.result
5
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;