objcmt-ns-macros.m.result revision c9820ebfeff30598ebd7369c5daf5bde10df934b
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
6typedef long NSInteger;
7typedef unsigned long NSUInteger;
8
9#define NS_ENUM(_type, _name) enum _name : _type _name; enum _name : _type
10#define NS_OPTIONS(_type, _name) enum _name : _type _name; enum _name : _type
11
12typedef NS_ENUM(NSInteger, wibble) {
13  blah,
14  blarg
15};
16
17
18typedef NS_ENUM(NSUInteger, UITableViewCellStyle) {
19    UIViewAutoresizingNone                 = 0,
20    UIViewAutoresizingFlexibleLeftMargin,
21    UIViewAutoresizingFlexibleWidth,
22    UIViewAutoresizingFlexibleRightMargin,
23    UIViewAutoresizingFlexibleTopMargin,
24    UIViewAutoresizingFlexibleHeight,
25    UIViewAutoresizingFlexibleBottomMargin
26};
27
28
29typedef NS_ENUM(NSInteger, UIViewAnimationTransition) {
30    UIViewAnimationTransitionNone,
31    UIViewAnimationTransitionFlipFromLeft,
32    UIViewAnimationTransitionFlipFromRight,
33    UIViewAnimationTransitionCurlUp,
34    UIViewAnimationTransitionCurlDown,
35} ;
36
37typedef NS_OPTIONS(NSUInteger, UITableView) {
38    UIViewOne   = 0,
39    UIViewTwo   = 1 << 0,
40    UIViewThree = 1 << 1,
41    UIViewFour  = 1 << 2,
42    UIViewFive  = 1 << 3,
43    UIViewSix   = 1 << 4,
44    UIViewSeven = 1 << 5
45} ;
46
47typedef NS_OPTIONS(NSUInteger, UI) {
48  UIOne = 0,
49  UITwo = 0x1,
50  UIthree = 0x8,
51  UIFour = 0x100
52};
53
54
55typedef NS_OPTIONS(NSUInteger, UIPOWER2) {
56  UIP2One = 0,
57  UIP2Two = 0x1,
58  UIP2three = 0x8,
59  UIP2Four = 0x100
60} ;
61
62enum {
63  UNOne,
64  UNTwo
65};
66
67// Should use NS_ENUM even though it is all power of 2.
68typedef NS_ENUM(NSInteger, UIK) {
69  UIKOne = 1,
70  UIKTwo = 2,
71};
72
73
74typedef NS_ENUM(NSInteger, NSTickMarkPosition)  {
75    NSTickMarkBelow = 0,
76    NSTickMarkAbove = 1,
77    NSTickMarkLeft = NSTickMarkAbove,
78    NSTickMarkRight = NSTickMarkBelow
79} ;
80
81typedef NS_OPTIONS(NSUInteger, UITableStyle) {
82    UIViewNone         = 0x0,
83    UIViewMargin       = 0x1,
84    UIViewWidth        = 0x2,
85    UIViewRightMargin  = 0x3,
86    UIViewBottomMargin = 0xbadbeef
87};
88
89
90typedef NS_OPTIONS(NSUInteger, UIStyle) {
91    UIView0         = 0,
92    UIView1 = 0XBADBEEF
93};
94
95
96typedef NS_ENUM(NSUInteger, NSBitmapImageFileType) {
97    NSTIFFFileType,
98    NSBMPFileType,
99    NSGIFFileType,
100    NSJPEGFileType,
101    NSPNGFileType,
102    NSJPEG2000FileType
103};
104
105
106typedef NS_ENUM(NSUInteger, NSAlertStyle) {
107    NSWarningAlertStyle = 0,
108    NSInformationalAlertStyle = 1,
109    NSCriticalAlertStyle = 2
110};
111
112
113