| // RUN: rm -rf %t |
| // 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 |
| // RUN: c-arcmt-test -mt-migrate-directory %t | arcmt-test -verify-transformed-files %s.result |
| // 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 |
| |
| typedef long NSInteger; |
| typedef unsigned long NSUInteger; |
| |
| #define NS_ENUM(_type, _name) enum _name : _type _name; enum _name : _type |
| #define NS_OPTIONS(_type, _name) enum _name : _type _name; enum _name : _type |
| |
| typedef NS_ENUM(NSInteger, wibble) { |
| blah, |
| blarg |
| }; |
| |
| |
| typedef NS_ENUM(NSUInteger, UITableViewCellStyle) { |
| UIViewAutoresizingNone = 0, |
| UIViewAutoresizingFlexibleLeftMargin, |
| UIViewAutoresizingFlexibleWidth, |
| UIViewAutoresizingFlexibleRightMargin, |
| UIViewAutoresizingFlexibleTopMargin, |
| UIViewAutoresizingFlexibleHeight, |
| UIViewAutoresizingFlexibleBottomMargin |
| }; |
| |
| |
| typedef NS_ENUM(NSInteger, UIViewAnimationTransition) { |
| UIViewAnimationTransitionNone, |
| UIViewAnimationTransitionFlipFromLeft, |
| UIViewAnimationTransitionFlipFromRight, |
| UIViewAnimationTransitionCurlUp, |
| UIViewAnimationTransitionCurlDown, |
| } ; |
| |
| typedef NS_OPTIONS(NSUInteger, UITableView) { |
| UIViewOne = 0, |
| UIViewTwo = 1 << 0, |
| UIViewThree = 1 << 1, |
| UIViewFour = 1 << 2, |
| UIViewFive = 1 << 3, |
| UIViewSix = 1 << 4, |
| UIViewSeven = 1 << 5 |
| } ; |
| |
| typedef NS_OPTIONS(NSUInteger, UI) { |
| UIOne = 0, |
| UITwo = 0x1, |
| UIthree = 0x8, |
| UIFour = 0x100 |
| }; |
| |
| |
| typedef NS_OPTIONS(NSUInteger, UIPOWER2) { |
| UIP2One = 0, |
| UIP2Two = 0x1, |
| UIP2three = 0x8, |
| UIP2Four = 0x100 |
| } ; |
| |
| enum { |
| UNOne, |
| UNTwo |
| }; |
| |
| // Should use NS_ENUM even though it is all power of 2. |
| typedef NS_ENUM(NSInteger, UIK) { |
| UIKOne = 1, |
| UIKTwo = 2, |
| }; |
| |
| |
| typedef NS_ENUM(NSInteger, NSTickMarkPosition) { |
| NSTickMarkBelow = 0, |
| NSTickMarkAbove = 1, |
| NSTickMarkLeft = NSTickMarkAbove, |
| NSTickMarkRight = NSTickMarkBelow |
| } ; |
| |
| typedef NS_OPTIONS(NSUInteger, UITableStyle) { |
| UIViewNone = 0x0, |
| UIViewMargin = 0x1, |
| UIViewWidth = 0x2, |
| UIViewRightMargin = 0x3, |
| UIViewBottomMargin = 0xbadbeef |
| }; |
| |
| |
| typedef NS_OPTIONS(NSUInteger, UIStyle) { |
| UIView0 = 0, |
| UIView1 = 0XBADBEEF |
| }; |
| |
| |
| typedef NS_ENUM(NSUInteger, NSBitmapImageFileType) { |
| NSTIFFFileType, |
| NSBMPFileType, |
| NSGIFFileType, |
| NSJPEGFileType, |
| NSPNGFileType, |
| NSJPEG2000FileType |
| }; |
| |
| |
| typedef NS_ENUM(NSUInteger, NSAlertStyle) { |
| NSWarningAlertStyle = 0, |
| NSInformationalAlertStyle = 1, |
| NSCriticalAlertStyle = 2 |
| }; |
| |
| |