summaryrefslogtreecommitdiff
path: root/test/ARCMT
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2014-10-07 19:01:46 +0000
committerFariborz Jahanian <fjahanian@apple.com>2014-10-07 19:01:46 +0000
commited0d4e804ceadcfa60544fd50a62a5f6c17d1547 (patch)
treeb97814441002955f11018dfe84f46c132f4ffad5 /test/ARCMT
parent45991fc3792a1a9a8f3cdf6bd0ba4309a8225ddb (diff)
Objective-C SDK modernization. When modernizing to
use NS_ENUM/NS_OPTIONS macros, add an import of Foundation.h (or its module) as necessary. rdar://18498550 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@219225 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/ARCMT')
-rw-r--r--test/ARCMT/objcmt-undefined-ns-macros.m24
-rw-r--r--test/ARCMT/objcmt-undefined-ns-macros.m.result24
2 files changed, 48 insertions, 0 deletions
diff --git a/test/ARCMT/objcmt-undefined-ns-macros.m b/test/ARCMT/objcmt-undefined-ns-macros.m
new file mode 100644
index 0000000000..2e1fa51d04
--- /dev/null
+++ b/test/ARCMT/objcmt-undefined-ns-macros.m
@@ -0,0 +1,24 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -fmodules -objcmt-migrate-ns-macros -mt-migrate-directory %t %s -x objective-c -fobjc-runtime-has-weak -fobjc-arc -triple x86_64-apple-darwin11
+// RUN: c-arcmt-test -mt-migrate-directory %t | arcmt-test -verify-transformed-files %s.result
+
+// rdar://18498550
+
+typedef long NSInteger;
+enum {
+ UIViewNone = 0x0,
+ UIViewMargin = 0x1,
+ UIViewWidth = 0x2,
+ UIViewRightMargin = 0x3,
+ UIViewBottomMargin = 0xbadbeef
+};
+typedef NSInteger UITableStyle;
+
+
+typedef
+ enum { two = 1 } NumericEnum2;
+
+typedef enum { three = 1 } NumericEnum3;
+
+typedef enum { four = 1 } NumericEnum4;
+
diff --git a/test/ARCMT/objcmt-undefined-ns-macros.m.result b/test/ARCMT/objcmt-undefined-ns-macros.m.result
new file mode 100644
index 0000000000..92cdfe3d7c
--- /dev/null
+++ b/test/ARCMT/objcmt-undefined-ns-macros.m.result
@@ -0,0 +1,24 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -fmodules -objcmt-migrate-ns-macros -mt-migrate-directory %t %s -x objective-c -fobjc-runtime-has-weak -fobjc-arc -triple x86_64-apple-darwin11
+// RUN: c-arcmt-test -mt-migrate-directory %t | arcmt-test -verify-transformed-files %s.result
+
+// rdar://18498550
+
+typedef long NSInteger;
+@import Foundation;
+typedef NS_OPTIONS(NSUInteger, UITableStyle) {
+ UIViewNone = 0x0,
+ UIViewMargin = 0x1,
+ UIViewWidth = 0x2,
+ UIViewRightMargin = 0x3,
+ UIViewBottomMargin = 0xbadbeef
+};
+
+
+typedef
+ NS_ENUM(NSInteger, NumericEnum2) { two = 1 };
+
+typedef NS_ENUM(NSInteger, NumericEnum3) { three = 1 };
+
+typedef NS_ENUM(NSInteger, NumericEnum4) { four = 1 };
+