Fariborz Jahanian | 9246327 | 2013-07-18 20:11:45 +0000 | [diff] [blame] | 1 | // 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 | |
| 6 | typedef long NSInteger; |
Fariborz Jahanian | b0057bb | 2013-07-19 01:05:49 +0000 | [diff] [blame] | 7 | typedef unsigned long NSUInteger; |
| 8 | |
Fariborz Jahanian | 9246327 | 2013-07-18 20:11:45 +0000 | [diff] [blame] | 9 | #define NS_ENUM(_type, _name) enum _name : _type _name; enum _name : _type |
Fariborz Jahanian | b0057bb | 2013-07-19 01:05:49 +0000 | [diff] [blame] | 10 | #define NS_OPTIONS(_type, _name) enum _name : _type _name; enum _name : _type |
Fariborz Jahanian | 75226d5 | 2013-09-17 21:56:04 +0000 | [diff] [blame] | 11 | #define DEPRECATED __attribute__((deprecated)) |
Fariborz Jahanian | 9246327 | 2013-07-18 20:11:45 +0000 | [diff] [blame] | 12 | |
| 13 | enum { |
| 14 | blah, |
| 15 | blarg |
| 16 | }; |
| 17 | typedef NSInteger wibble; |
Fariborz Jahanian | b0057bb | 2013-07-19 01:05:49 +0000 | [diff] [blame] | 18 | |
| 19 | enum { |
| 20 | UIViewAutoresizingNone = 0, |
Fariborz Jahanian | d0f6f79 | 2013-07-22 18:53:45 +0000 | [diff] [blame] | 21 | UIViewAutoresizingFlexibleLeftMargin, |
| 22 | UIViewAutoresizingFlexibleWidth, |
| 23 | UIViewAutoresizingFlexibleRightMargin, |
| 24 | UIViewAutoresizingFlexibleTopMargin, |
| 25 | UIViewAutoresizingFlexibleHeight, |
| 26 | UIViewAutoresizingFlexibleBottomMargin |
Fariborz Jahanian | b0057bb | 2013-07-19 01:05:49 +0000 | [diff] [blame] | 27 | }; |
Fariborz Jahanian | b0057bb | 2013-07-19 01:05:49 +0000 | [diff] [blame] | 28 | typedef NSUInteger UITableViewCellStyle; |
| 29 | |
Fariborz Jahanian | c1c44f6 | 2013-07-19 20:18:36 +0000 | [diff] [blame] | 30 | typedef enum { |
| 31 | UIViewAnimationTransitionNone, |
| 32 | UIViewAnimationTransitionFlipFromLeft, |
| 33 | UIViewAnimationTransitionFlipFromRight, |
| 34 | UIViewAnimationTransitionCurlUp, |
| 35 | UIViewAnimationTransitionCurlDown, |
| 36 | } UIViewAnimationTransition; |
| 37 | |
Fariborz Jahanian | d0f6f79 | 2013-07-22 18:53:45 +0000 | [diff] [blame] | 38 | typedef 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 | |
| 48 | enum { |
| 49 | UIOne = 0, |
| 50 | UITwo = 0x1, |
| 51 | UIthree = 0x8, |
| 52 | UIFour = 0x100 |
| 53 | }; |
| 54 | typedef NSInteger UI; |
| 55 | |
| 56 | typedef enum { |
| 57 | UIP2One = 0, |
| 58 | UIP2Two = 0x1, |
| 59 | UIP2three = 0x8, |
| 60 | UIP2Four = 0x100 |
| 61 | } UIPOWER2; |
| 62 | |
Fariborz Jahanian | 008ef72 | 2013-07-19 17:44:32 +0000 | [diff] [blame] | 63 | enum { |
| 64 | UNOne, |
| 65 | UNTwo |
| 66 | }; |
| 67 | |
Fariborz Jahanian | be7bc11 | 2013-08-15 18:46:37 +0000 | [diff] [blame] | 68 | // Should use NS_ENUM even though it is all power of 2. |
| 69 | enum { |
Fariborz Jahanian | a23f4fb | 2013-08-30 00:10:37 +0000 | [diff] [blame] | 70 | UIKOne = 1, |
| 71 | UIKTwo = 2, |
Fariborz Jahanian | be7bc11 | 2013-08-15 18:46:37 +0000 | [diff] [blame] | 72 | }; |
| 73 | typedef NSInteger UIK; |
Fariborz Jahanian | 313ae70 | 2013-08-15 19:27:42 +0000 | [diff] [blame] | 74 | |
| 75 | typedef enum { |
| 76 | NSTickMarkBelow = 0, |
| 77 | NSTickMarkAbove = 1, |
| 78 | NSTickMarkLeft = NSTickMarkAbove, |
| 79 | NSTickMarkRight = NSTickMarkBelow |
| 80 | } NSTickMarkPosition; |
Fariborz Jahanian | a23f4fb | 2013-08-30 00:10:37 +0000 | [diff] [blame] | 81 | |
| 82 | enum { |
| 83 | UIViewNone = 0x0, |
| 84 | UIViewMargin = 0x1, |
| 85 | UIViewWidth = 0x2, |
| 86 | UIViewRightMargin = 0x3, |
| 87 | UIViewBottomMargin = 0xbadbeef |
| 88 | }; |
| 89 | typedef NSInteger UITableStyle; |
| 90 | |
| 91 | enum { |
| 92 | UIView0 = 0, |
| 93 | UIView1 = 0XBADBEEF |
| 94 | }; |
| 95 | typedef NSInteger UIStyle; |
Fariborz Jahanian | ff3476e | 2013-08-30 17:46:01 +0000 | [diff] [blame] | 96 | |
| 97 | enum { |
| 98 | NSTIFFFileType, |
| 99 | NSBMPFileType, |
| 100 | NSGIFFileType, |
| 101 | NSJPEGFileType, |
| 102 | NSPNGFileType, |
| 103 | NSJPEG2000FileType |
| 104 | }; |
| 105 | typedef NSUInteger NSBitmapImageFileType; |
| 106 | |
| 107 | enum { |
| 108 | NSWarningAlertStyle = 0, |
| 109 | NSInformationalAlertStyle = 1, |
| 110 | NSCriticalAlertStyle = 2 |
| 111 | }; |
| 112 | typedef NSUInteger NSAlertStyle; |
| 113 | |
Fariborz Jahanian | 75226d5 | 2013-09-17 21:56:04 +0000 | [diff] [blame] | 114 | enum { |
| 115 | D_NSTIFFFileType, |
| 116 | D_NSBMPFileType, |
| 117 | D_NSGIFFileType, |
| 118 | D_NSJPEGFileType, |
| 119 | D_NSPNGFileType, |
| 120 | D_NSJPEG2000FileType |
| 121 | }; |
| 122 | typedef NSUInteger D_NSBitmapImageFileType DEPRECATED; |
| 123 | |
| 124 | typedef enum { |
| 125 | D_NSTickMarkBelow = 0, |
| 126 | D_NSTickMarkAbove = 1 |
| 127 | } D_NSTickMarkPosition DEPRECATED; |
| 128 | |
Fariborz Jahanian | 6e1798e | 2013-09-17 23:32:51 +0000 | [diff] [blame^] | 129 | |
| 130 | #define NS_ENUM_AVAILABLE(X,Y) |
| 131 | |
| 132 | enum { |
| 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 | |
| 148 | typedef NSUInteger NSFOptions; |