diff options
Diffstat (limited to 'test/ARCMT')
77 files changed, 744 insertions, 254 deletions
diff --git a/test/ARCMT/GC-check-warn-nsalloc.m b/test/ARCMT/GC-check-warn-nsalloc.m index 5ce36c40d659..44ccc95e3f7c 100644 --- a/test/ARCMT/GC-check-warn-nsalloc.m +++ b/test/ARCMT/GC-check-warn-nsalloc.m @@ -1,12 +1,11 @@ -// RUN: %clang_cc1 -arcmt-check -verify -no-ns-alloc-error -triple x86_64-apple-darwin10 -fobjc-gc-only %s -// RUN: %clang_cc1 -arcmt-check -verify -no-ns-alloc-error -triple x86_64-apple-darwin10 -fobjc-gc-only -x objective-c++ %s -// DISABLE: mingw32 +// RUN: %clang_cc1 -arcmt-check -no-ns-alloc-error -triple x86_64-apple-darwin10 -fobjc-gc-only %s 2>&1 | grep 'warning: \[rewriter\] call returns pointer to GC managed memory' +// RUN: %clang_cc1 -arcmt-check -no-ns-alloc-error -triple x86_64-apple-darwin10 -fobjc-gc-only -x objective-c++ %s 2>&1 | grep 'warning: \[rewriter\] call returns pointer to GC managed memory' +// TODO: Investigate VerifyDiagnosticConsumer failures on these tests when using -verify. // rdar://10532541 -// XFAIL: * typedef unsigned NSUInteger; void *__strong NSAllocateCollectable(NSUInteger size, NSUInteger options); void test1() { - NSAllocateCollectable(100, 0); // expected-warning {{call returns pointer to GC managed memory; it will become unmanaged in ARC}} + NSAllocateCollectable(100, 0); } diff --git a/test/ARCMT/GC-check.m b/test/ARCMT/GC-check.m index 3a1b67ce2183..9864354228be 100644 --- a/test/ARCMT/GC-check.m +++ b/test/ARCMT/GC-check.m @@ -1,6 +1,5 @@ // RUN: %clang_cc1 -arcmt-check -verify -triple x86_64-apple-darwin10 -fobjc-gc-only %s // RUN: %clang_cc1 -arcmt-check -verify -triple x86_64-apple-darwin10 -fobjc-gc-only -x objective-c++ %s -// DISABLE: mingw32 #define CF_AUTOMATED_REFCOUNT_UNAVAILABLE __attribute__((unavailable("not available in automatic reference counting mode"))) typedef unsigned NSUInteger; diff --git a/test/ARCMT/GC-no-arc-runtime.m b/test/ARCMT/GC-no-arc-runtime.m index f0699927eda5..376134e73f21 100644 --- a/test/ARCMT/GC-no-arc-runtime.m +++ b/test/ARCMT/GC-no-arc-runtime.m @@ -3,7 +3,6 @@ // RUN: diff %t %s.result // RUN: arcmt-test --args -triple x86_64-apple-macosx10.6 -fsyntax-only -fobjc-gc-only -x objective-c++ %s > %t // RUN: diff %t %s.result -// DISABLE: mingw32 #include "Common.h" #include "GC.h" diff --git a/test/ARCMT/GC-no-arc-runtime.m.result b/test/ARCMT/GC-no-arc-runtime.m.result index f55ca38070e9..c338bdb2ed47 100644 --- a/test/ARCMT/GC-no-arc-runtime.m.result +++ b/test/ARCMT/GC-no-arc-runtime.m.result @@ -3,7 +3,6 @@ // RUN: diff %t %s.result // RUN: arcmt-test --args -triple x86_64-apple-macosx10.6 -fsyntax-only -fobjc-gc-only -x objective-c++ %s > %t // RUN: diff %t %s.result -// DISABLE: mingw32 #include "Common.h" #include "GC.h" diff --git a/test/ARCMT/GC-no-finalize-removal.m b/test/ARCMT/GC-no-finalize-removal.m index 14e8602446c3..a8db819d90b8 100644 --- a/test/ARCMT/GC-no-finalize-removal.m +++ b/test/ARCMT/GC-no-finalize-removal.m @@ -3,7 +3,6 @@ // RUN: diff %t %s.result // RUN: arcmt-test --args -triple x86_64-apple-macosx10.7 -fsyntax-only -fobjc-gc-only -no-finalize-removal -x objective-c++ %s > %t // RUN: diff %t %s.result -// DISABLE: mingw32 #include "Common.h" #include "GC.h" diff --git a/test/ARCMT/GC-no-finalize-removal.m.result b/test/ARCMT/GC-no-finalize-removal.m.result index ea14873ec353..b563d196ee65 100644 --- a/test/ARCMT/GC-no-finalize-removal.m.result +++ b/test/ARCMT/GC-no-finalize-removal.m.result @@ -3,7 +3,6 @@ // RUN: diff %t %s.result // RUN: arcmt-test --args -triple x86_64-apple-macosx10.7 -fsyntax-only -fobjc-gc-only -no-finalize-removal -x objective-c++ %s > %t // RUN: diff %t %s.result -// DISABLE: mingw32 #include "Common.h" #include "GC.h" diff --git a/test/ARCMT/GC.m b/test/ARCMT/GC.m index eebbaf6854d9..2c9ea9ca3324 100644 --- a/test/ARCMT/GC.m +++ b/test/ARCMT/GC.m @@ -3,7 +3,6 @@ // RUN: diff %t %s.result // RUN: arcmt-test --args -triple x86_64-apple-macosx10.7 -fsyntax-only -fobjc-gc-only -x objective-c++ %s > %t // RUN: diff %t %s.result -// DISABLE: mingw32 #include "Common.h" #include "GC.h" diff --git a/test/ARCMT/GC.m.result b/test/ARCMT/GC.m.result index c2c523f77e99..595ff23a7259 100644 --- a/test/ARCMT/GC.m.result +++ b/test/ARCMT/GC.m.result @@ -3,7 +3,6 @@ // RUN: diff %t %s.result // RUN: arcmt-test --args -triple x86_64-apple-macosx10.7 -fsyntax-only -fobjc-gc-only -x objective-c++ %s > %t // RUN: diff %t %s.result -// DISABLE: mingw32 #include "Common.h" #include "GC.h" diff --git a/test/ARCMT/Inputs/Module.framework/Frameworks/SubFramework.framework/Headers/SubFramework.h b/test/ARCMT/Inputs/Module.framework/Frameworks/SubFramework.framework/Headers/SubFramework.h new file mode 100644 index 000000000000..f7f9fb66c9e9 --- /dev/null +++ b/test/ARCMT/Inputs/Module.framework/Frameworks/SubFramework.framework/Headers/SubFramework.h @@ -0,0 +1,5 @@ +#ifndef MODULE_SUBFRAMEWORK_H +#define MODULE_SUBFRAMEWORK_H +#__private_macro MODULE_SUBFRAMEWORK_H +char *module_subframework; +#endif diff --git a/test/ARCMT/Inputs/Module.framework/Headers/Buried/Treasure.h b/test/ARCMT/Inputs/Module.framework/Headers/Buried/Treasure.h new file mode 100644 index 000000000000..6e81adcb2b60 --- /dev/null +++ b/test/ARCMT/Inputs/Module.framework/Headers/Buried/Treasure.h @@ -0,0 +1 @@ +unsigned *Buried_Treasure; diff --git a/test/ARCMT/Inputs/Module.framework/Headers/Module.h b/test/ARCMT/Inputs/Module.framework/Headers/Module.h new file mode 100644 index 000000000000..3d2476b20431 --- /dev/null +++ b/test/ARCMT/Inputs/Module.framework/Headers/Module.h @@ -0,0 +1,28 @@ +// expected-warning 0-1 {{umbrella header}} + +// FIXME: The "umbrella header" warning should be moved to a separate test. +// This "0-1" is only here because the warning is only emitted when the +// module is (otherwise) successfully included. + +#ifndef MODULE_H +#define MODULE_H +const char *getModuleVersion(void); + +#ifdef FOO +# error Module should have been built without -DFOO +#endif + +@interface Module ++(const char *)version; // retrieve module version ++alloc; +@end + +#define MODULE_H_MACRO 1 +#__private_macro MODULE_H_MACRO + +#include <Module/Sub.h> +#include <Module/Buried/Treasure.h> + +__asm("foo"); + +#endif // MODULE_H diff --git a/test/ARCMT/Inputs/Module.framework/Headers/NotInModule.h b/test/ARCMT/Inputs/Module.framework/Headers/NotInModule.h new file mode 100644 index 000000000000..6b15791eb2c7 --- /dev/null +++ b/test/ARCMT/Inputs/Module.framework/Headers/NotInModule.h @@ -0,0 +1 @@ +int not_in_module; diff --git a/test/ARCMT/Inputs/Module.framework/Headers/Sub.h b/test/ARCMT/Inputs/Module.framework/Headers/Sub.h new file mode 100644 index 000000000000..dea76e764617 --- /dev/null +++ b/test/ARCMT/Inputs/Module.framework/Headers/Sub.h @@ -0,0 +1,3 @@ +#include <Module/Sub2.h> +int *Module_Sub; + diff --git a/test/ARCMT/Inputs/Module.framework/Headers/Sub2.h b/test/ARCMT/Inputs/Module.framework/Headers/Sub2.h new file mode 100644 index 000000000000..beed4a862dca --- /dev/null +++ b/test/ARCMT/Inputs/Module.framework/Headers/Sub2.h @@ -0,0 +1 @@ +int *Module_Sub2; diff --git a/test/ARCMT/Inputs/Module.framework/Module b/test/ARCMT/Inputs/Module.framework/Module new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/test/ARCMT/Inputs/Module.framework/Module diff --git a/test/ARCMT/Inputs/Module.framework/PrivateHeaders/ModulePrivate.h b/test/ARCMT/Inputs/Module.framework/PrivateHeaders/ModulePrivate.h new file mode 100644 index 000000000000..0782336df9de --- /dev/null +++ b/test/ARCMT/Inputs/Module.framework/PrivateHeaders/ModulePrivate.h @@ -0,0 +1 @@ +int module_private; diff --git a/test/ARCMT/Inputs/module.map b/test/ARCMT/Inputs/module.map new file mode 100644 index 000000000000..061abbd24d57 --- /dev/null +++ b/test/ARCMT/Inputs/module.map @@ -0,0 +1,309 @@ +module c_library [extern_c] { module inner { header "c-header.h" } } +module cxx_library { header "cxx-header.h" requires cplusplus } +module c_library_bad [extern_c] { header "c-header-bad.h" } +module diamond_top { header "diamond_top.h" } +module diamond_left { + header "diamond_left.h" + export diamond_top +} +module diamond_right { + header "diamond_right.h" + export diamond_top +} +module diamond_bottom { + header "diamond_bottom.h" + export * +} +module irgen { header "irgen.h" } +module cxx_irgen_top { header "cxx-irgen-top.h" } +module cxx_irgen_left { header "cxx-irgen-left.h" } +module cxx_irgen_right { header "cxx-irgen-right.h" } +module lookup_left_objc { header "lookup_left.h" } +module lookup_right_objc { header "lookup_right.h" } +module lookup_left_cxx { header "lookup_left.hpp" } +module lookup_right_cxx { header "lookup_right.hpp" } +module module_private_left { header "module_private_left.h" } +module module_private_right { header "module_private_right.h" } +module macros_top { + header "macros_top.h" + explicit module b { header "macros_top_b.h" } + explicit module c { header "macros_top_c.h" } +} +module macros_left { + header "macros_left.h" + export * +} +module macros_right { + header "macros_right.h" + export * + explicit module undef { + header "macros_right_undef.h" + } +} +module macros { header "macros.h" } +module macros_other { header "macros_other.h" } +module category_top { header "category_top.h" } +module category_left { + header "category_left.h" + export category_top + + explicit module sub { + header "category_left_sub.h" + } +} +module category_right { + header "category_right.h" + export category_top + + explicit module sub { + header "category_right_sub.h" + } +} +module category_bottom { + header "category_bottom.h" + export category_left + export category_right +} +module category_other { header "category_other.h" } +module redeclarations_left { header "redeclarations_left.h" } +module redeclarations_right { header "redeclarations_right.h" } +module redecl_namespaces_left { header "redecl_namespaces_left.h" } +module redecl_namespaces_right { header "redecl_namespaces_right.h" } +module redecl_add_after_load_top { header "redecl-add-after-load-top.h" } +module redecl_add_after_load { header "redecl-add-after-load.h" } +module load_failure { header "load_failure.h" } + +module decldef { + explicit module Decl { header "decl.h" } + explicit module Decl2 { header "decl2.h" } + explicit module Def { header "def.h" } +} + +module redecl_merge_top { + header "redecl-merge-top.h" + explicit module Explicit { header "redecl-merge-top-explicit.h" } + exclude header "nonexistent.h" +} +module redecl_merge_left { + header "redecl-merge-left.h" + export * +} +module redecl_merge_left_left { + header "redecl-merge-left-left.h" + export * +} +module redecl_merge_right { + header "redecl-merge-right.h" + export * +} +module redecl_merge_bottom { + explicit module prefix { + header "redecl-merge-bottom-prefix.h" + } + + header "redecl-merge-bottom.h" + export * +} +module namespaces_top { + header "namespaces-top.h" + export * +} +module namespaces_left { + header "namespaces-left.h" + export * +} +module namespaces_right { + header "namespaces-right.h" + export * +} +module templates_top { + header "templates-top.h" + export * +} +module templates_left { + header "templates-left.h" + export * +} +module templates_right { + header "templates-right.h" + export * +} +module MethodPoolA { + header "MethodPoolA.h" + + explicit module Sub2 { + header "MethodPoolASub2.h" + } + + explicit module Sub { + header "MethodPoolASub.h" + } +} +module MethodPoolB { + header "MethodPoolB.h" + + explicit module Sub2 { + header "MethodPoolBSub2.h" + } + + explicit module Sub { + header "MethodPoolBSub.h" + } +} +module import_decl { + header "import-decl.h" +} + +framework module * { + exclude NotAModule +} + +module linkage_merge_left { + explicit module sub { + header "linkage-merge-sub.h" + } +} + +module autolink { + header "autolink.h" + link "autolink" + + explicit module sub { + header "autolink-sub.h" + link "autolink_sub" + } + + explicit module sub2 { + header "autolink-sub2.h" + link framework "autolink_framework" + } + + explicit module sub3 { + header "autolink-sub3.h" + link "autolink_from_pch" + } +} + +module weird_objc { + header "weird_objc.h" +} + +module ignored_macros { + header "ignored_macros.h" +} + +module cxx_many_overloads { + header "cxx-many-overloads.h" +} + +module cxx_inline_namespace { + header "cxx-inline-namespace.h" +} + +module cxx_inline_namespace_b { + header "cxx-inline-namespace-b.h" +} + +module cxx_linkage_cache { + header "cxx-linkage-cache.h" +} + +module cxx_templates_common { + header "cxx-templates-common.h" +} + +module cxx_templates_a { + header "cxx-templates-a.h" +} + +module cxx_templates_b_impl { + header "cxx-templates-b-impl.h" +} + +module cxx_templates_b { + header "cxx-templates-b.h" +} + +module cxx_templates_c { + header "cxx-templates-c.h" +} + +module cxx_decls { + module unimported { + header "cxx-decls-unimported.h" + } + module imported { + header "cxx-decls-imported.h" + } +} + +module config { + header "config.h" + config_macros [exhaustive] WANT_FOO, WANT_BAR +} + +module diag_pragma { + header "diag_pragma.h" +} + +module dummy { + header "dummy.h" +} + +module builtin { + header "builtin.h" + explicit module sub { + header "builtin_sub.h" + } +} + +module linkage_merge { + explicit module foo { + header "linkage-merge-foo.h" + } + explicit module bar { + header "linkage-merge-bar.h" + } + +} + +module incomplete_mod { + header "incomplete_mod.h" +} + +module warning { + header "warning.h" +} + +module initializer_list { + header "initializer_list" +} + +module using_decl { + module a { header "using-decl-a.h" export * } + module b { header "using-decl-b.h" export * } +} + +module recursive_visibility_a1 { + module inner { header "recursive_visibility_a1_inner.h" } +} +module recursive_visibility_a2 { + module inner { + module more_inner { + header "recursive_visibility_a2_more_inner.h" + } + } +} +module recursive_visibility_b { + header "recursive_visibility_b.h" + export * +} +module recursive_visibility_c { + header "recursive_visibility_c.h" +} +module recursive1 { + header "recursive1.h" +} +module recursive2 { + header "recursive2.h" +} diff --git a/test/ARCMT/api.m b/test/ARCMT/api.m index ba122c42bff3..b186ec724745 100644 --- a/test/ARCMT/api.m +++ b/test/ARCMT/api.m @@ -1,7 +1,6 @@ // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -fobjc-arc -x objective-c %s.result // RUN: arcmt-test --args -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c %s > %t // RUN: diff %t %s.result -// DISABLE: mingw32 #include "Common.h" diff --git a/test/ARCMT/api.m.result b/test/ARCMT/api.m.result index 7e04e7dc0c88..e3093751b626 100644 --- a/test/ARCMT/api.m.result +++ b/test/ARCMT/api.m.result @@ -1,7 +1,6 @@ // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -fobjc-arc -x objective-c %s.result // RUN: arcmt-test --args -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c %s > %t // RUN: diff %t %s.result -// DISABLE: mingw32 #include "Common.h" diff --git a/test/ARCMT/assign-prop-with-arc-runtime.m b/test/ARCMT/assign-prop-with-arc-runtime.m index c357eeb17177..a00538cd6197 100644 --- a/test/ARCMT/assign-prop-with-arc-runtime.m +++ b/test/ARCMT/assign-prop-with-arc-runtime.m @@ -1,7 +1,6 @@ // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -fobjc-arc -fobjc-runtime-has-weak -x objective-c %s.result // RUN: arcmt-test --args -triple x86_64-apple-macosx10.7 -fsyntax-only %s > %t // RUN: diff %t %s.result -// DISABLE: mingw32 #include "Common.h" diff --git a/test/ARCMT/assign-prop-with-arc-runtime.m.result b/test/ARCMT/assign-prop-with-arc-runtime.m.result index a255a36f2494..8bb684f79a33 100644 --- a/test/ARCMT/assign-prop-with-arc-runtime.m.result +++ b/test/ARCMT/assign-prop-with-arc-runtime.m.result @@ -1,7 +1,6 @@ // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -fobjc-arc -fobjc-runtime-has-weak -x objective-c %s.result // RUN: arcmt-test --args -triple x86_64-apple-macosx10.7 -fsyntax-only %s > %t // RUN: diff %t %s.result -// DISABLE: mingw32 #include "Common.h" diff --git a/test/ARCMT/atautorelease-2.m b/test/ARCMT/atautorelease-2.m index 5c2cd6b922fd..b9bc10655325 100644 --- a/test/ARCMT/atautorelease-2.m +++ b/test/ARCMT/atautorelease-2.m @@ -1,7 +1,6 @@ // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -fobjc-arc -x objective-c %s.result // RUN: arcmt-test --args -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c %s > %t // RUN: diff %t %s.result -// DISABLE: mingw32 @interface NSAutoreleasePool - drain; diff --git a/test/ARCMT/atautorelease-2.m.result b/test/ARCMT/atautorelease-2.m.result index 06bf0d51e4bb..205473380b73 100644 --- a/test/ARCMT/atautorelease-2.m.result +++ b/test/ARCMT/atautorelease-2.m.result @@ -1,7 +1,6 @@ // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -fobjc-arc -x objective-c %s.result // RUN: arcmt-test --args -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c %s > %t // RUN: diff %t %s.result -// DISABLE: mingw32 @interface NSAutoreleasePool - drain; diff --git a/test/ARCMT/atautorelease-3.m b/test/ARCMT/atautorelease-3.m index 0b6abdf83c46..87b80af9350e 100644 --- a/test/ARCMT/atautorelease-3.m +++ b/test/ARCMT/atautorelease-3.m @@ -1,7 +1,6 @@ // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -fobjc-arc -x objective-c %s.result // RUN: arcmt-test --args -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c %s > %t // RUN: diff %t %s.result -// DISABLE: mingw32 @interface NSAutoreleasePool - drain; diff --git a/test/ARCMT/atautorelease-3.m.result b/test/ARCMT/atautorelease-3.m.result index 9103de4167ef..801376a7e82b 100644 --- a/test/ARCMT/atautorelease-3.m.result +++ b/test/ARCMT/atautorelease-3.m.result @@ -1,7 +1,6 @@ // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -fobjc-arc -x objective-c %s.result // RUN: arcmt-test --args -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c %s > %t // RUN: diff %t %s.result -// DISABLE: mingw32 @interface NSAutoreleasePool - drain; diff --git a/test/ARCMT/atautorelease-check.m b/test/ARCMT/atautorelease-check.m index 8daf9d6bdeed..d74ef3b61d1f 100644 --- a/test/ARCMT/atautorelease-check.m +++ b/test/ARCMT/atautorelease-check.m @@ -1,5 +1,4 @@ // RUN: %clang_cc1 -arcmt-check -verify -triple x86_64-apple-darwin10 %s -// DISABLE: mingw32 #if __has_feature(objc_arr) #define NS_AUTOMATED_REFCOUNT_UNAVAILABLE __attribute__((unavailable("not available in automatic reference counting mode"))) diff --git a/test/ARCMT/atautorelease.m b/test/ARCMT/atautorelease.m index 132553bdd331..a6aed146497b 100644 --- a/test/ARCMT/atautorelease.m +++ b/test/ARCMT/atautorelease.m @@ -1,7 +1,6 @@ // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -fobjc-arc -x objective-c %s.result // RUN: arcmt-test --args -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c %s > %t // RUN: diff %t %s.result -// DISABLE: mingw32 #include "Common.h" diff --git a/test/ARCMT/atautorelease.m.result b/test/ARCMT/atautorelease.m.result index 5191f4738eb8..e24339a3b9e3 100644 --- a/test/ARCMT/atautorelease.m.result +++ b/test/ARCMT/atautorelease.m.result @@ -1,7 +1,6 @@ // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -fobjc-arc -x objective-c %s.result // RUN: arcmt-test --args -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c %s > %t // RUN: diff %t %s.result -// DISABLE: mingw32 #include "Common.h" diff --git a/test/ARCMT/autoreleases.m b/test/ARCMT/autoreleases.m index 543bcf6632af..91413e51ca66 100644 --- a/test/ARCMT/autoreleases.m +++ b/test/ARCMT/autoreleases.m @@ -1,7 +1,6 @@ // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -fobjc-arc -x objective-c %s.result // RUN: arcmt-test --args -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c %s > %t // RUN: diff %t %s.result -// DISABLE: mingw32 #include "Common.h" diff --git a/test/ARCMT/autoreleases.m.result b/test/ARCMT/autoreleases.m.result index 9b71ff8b8945..32c7ad3c3971 100644 --- a/test/ARCMT/autoreleases.m.result +++ b/test/ARCMT/autoreleases.m.result @@ -1,7 +1,6 @@ // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -fobjc-arc -x objective-c %s.result // RUN: arcmt-test --args -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c %s > %t // RUN: diff %t %s.result -// DISABLE: mingw32 #include "Common.h" diff --git a/test/ARCMT/check-with-pch.m b/test/ARCMT/check-with-pch.m index 786700292ad0..1a94dda796b9 100644 --- a/test/ARCMT/check-with-pch.m +++ b/test/ARCMT/check-with-pch.m @@ -1,6 +1,5 @@ // RUN: %clang_cc1 -x objective-c -triple x86_64-apple-darwin10 %S/Common.h -emit-pch -o %t.pch // RUN: %clang_cc1 -include-pch %t.pch -arcmt-check -verify -triple x86_64-apple-darwin10 -fblocks -Werror %s -// DISABLE: mingw32 // rdar://9601437 @interface I9601437 { diff --git a/test/ARCMT/checking-in-arc.m b/test/ARCMT/checking-in-arc.m index 40d9b1684576..d41a162289b2 100644 --- a/test/ARCMT/checking-in-arc.m +++ b/test/ARCMT/checking-in-arc.m @@ -1,5 +1,4 @@ // RUN: %clang_cc1 -arcmt-check -fobjc-arc -fobjc-runtime=macosx-10.8.0 -triple x86_64-apple-darwin12 -fblocks -Werror %s -// DISABLE: mingw32 #if __has_feature(objc_arc) #define NS_AUTOMATED_REFCOUNT_UNAVAILABLE __attribute__((unavailable("not available in automatic reference counting mode"))) diff --git a/test/ARCMT/checking.m b/test/ARCMT/checking.m index a550633171d1..7815103822a1 100644 --- a/test/ARCMT/checking.m +++ b/test/ARCMT/checking.m @@ -1,5 +1,4 @@ // RUN: %clang_cc1 -arcmt-check -verify -triple x86_64-apple-darwin10 -fblocks -Werror %s -// DISABLE: mingw32 #if __has_feature(objc_arc) #define NS_AUTOMATED_REFCOUNT_UNAVAILABLE __attribute__((unavailable("not available in automatic reference counting mode"))) @@ -45,9 +44,9 @@ struct UnsafeS { }; @interface A : NSObject -- (id)retain; // expected-note {{declaration has been explicitly marked unavailable here}} -- (id)retainCount; // expected-note {{declaration has been explicitly marked unavailable here}} -- (id)autorelease; // expected-note 2 {{declaration has been explicitly marked unavailable here}} +- (id)retain; // expected-note {{'retain' has been explicitly marked unavailable here}} +- (id)retainCount; // expected-note {{'retainCount' has been explicitly marked unavailable here}} +- (id)autorelease; // expected-note 2 {{'autorelease' has been explicitly marked unavailable here}} - (id)init; - (oneway void)release; - (void)dealloc; diff --git a/test/ARCMT/cxx-checking.mm b/test/ARCMT/cxx-checking.mm index 2f5d5d51655a..aa3bc466f672 100644 --- a/test/ARCMT/cxx-checking.mm +++ b/test/ARCMT/cxx-checking.mm @@ -1,5 +1,4 @@ // RUN: %clang_cc1 -arcmt-check -verify -triple x86_64-apple-darwin10 -fsyntax-only -fblocks %s -// DISABLE: mingw32 // Classes that have an Objective-C object pointer. struct HasObjectMember0 { @@ -81,7 +80,7 @@ int check_non_pod_block1[__is_pod(int (^ __unsafe_unretained)(int))? 1 : -1]; struct FlexibleArrayMember0 { int length; - id array[]; // expected-error{{flexible array member 'array' of non-POD element type 'id __strong[]'}} + id array[]; // expected-error{{flexible array member 'array' of type 'id __strong[]' with non-trivial destruction}} }; struct FlexibleArrayMember1 { diff --git a/test/ARCMT/cxx-rewrite.mm b/test/ARCMT/cxx-rewrite.mm index 92bb71807d00..4a9c50c92426 100644 --- a/test/ARCMT/cxx-rewrite.mm +++ b/test/ARCMT/cxx-rewrite.mm @@ -1,7 +1,6 @@ // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -fobjc-arc -x objective-c++ %s.result // RUN: arcmt-test --args -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c++ %s > %t // RUN: diff %t %s.result -// DISABLE: mingw32 #include "Common.h" diff --git a/test/ARCMT/cxx-rewrite.mm.result b/test/ARCMT/cxx-rewrite.mm.result index 7c944d5f240a..a96d254bf463 100644 --- a/test/ARCMT/cxx-rewrite.mm.result +++ b/test/ARCMT/cxx-rewrite.mm.result @@ -1,7 +1,6 @@ // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -fobjc-arc -x objective-c++ %s.result // RUN: arcmt-test --args -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c++ %s > %t // RUN: diff %t %s.result -// DISABLE: mingw32 #include "Common.h" diff --git a/test/ARCMT/dealloc.m b/test/ARCMT/dealloc.m index 34df1a49b693..d7a72af4f726 100644 --- a/test/ARCMT/dealloc.m +++ b/test/ARCMT/dealloc.m @@ -1,7 +1,6 @@ // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -fobjc-arc -x objective-c %s.result // RUN: arcmt-test --args -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c %s > %t // RUN: diff %t %s.result -// DISABLE: mingw32 @interface A - (id)retain; diff --git a/test/ARCMT/dealloc.m.result b/test/ARCMT/dealloc.m.result index 3ff2885341c4..fbd9e445d275 100644 --- a/test/ARCMT/dealloc.m.result +++ b/test/ARCMT/dealloc.m.result @@ -1,7 +1,6 @@ // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -fobjc-arc -x objective-c %s.result // RUN: arcmt-test --args -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c %s > %t // RUN: diff %t %s.result -// DISABLE: mingw32 @interface A - (id)retain; diff --git a/test/ARCMT/designated-init-in-header/designated-init-in-header.m b/test/ARCMT/designated-init-in-header/designated-init-in-header.m new file mode 100644 index 000000000000..8286583b3c89 --- /dev/null +++ b/test/ARCMT/designated-init-in-header/designated-init-in-header.m @@ -0,0 +1,3 @@ +// RUN: %clang_cc1 -objcmt-migrate-designated-init -objcmt-migrate-readwrite-property -objcmt-migrate-instancetype -x objective-c %S/file1.m.in -triple x86_64-apple-darwin11 -fobjc-arc -migrate -o %t1.remap +// RUN: %clang_cc1 -objcmt-migrate-designated-init -objcmt-migrate-readwrite-property -objcmt-migrate-instancetype -x objective-c %S/file2.m.in -triple x86_64-apple-darwin11 -fobjc-arc -migrate -o %t2.remap +// RUN: c-arcmt-test %t1.remap %t2.remap | arcmt-test -verify-transformed-files %S/header1.h.result %S/file2.m.in.result diff --git a/test/ARCMT/designated-init-in-header/file1.m.in b/test/ARCMT/designated-init-in-header/file1.m.in new file mode 100644 index 000000000000..0201b32abd32 --- /dev/null +++ b/test/ARCMT/designated-init-in-header/file1.m.in @@ -0,0 +1,2 @@ +#include "header1.h" + diff --git a/test/ARCMT/designated-init-in-header/file2.m.in b/test/ARCMT/designated-init-in-header/file2.m.in new file mode 100644 index 000000000000..258159735a77 --- /dev/null +++ b/test/ARCMT/designated-init-in-header/file2.m.in @@ -0,0 +1,14 @@ +#include "header1.h" + +@implementation S1 +-(int)prop { return 0; } +-(void)setProp:(int)p {} ++(id)s1 { return 0; } +-(id)initWithFoo:(NSString*)foo +{ + self = [super init]; + if (self) { + } + return self; +} +@end diff --git a/test/ARCMT/designated-init-in-header/file2.m.in.result b/test/ARCMT/designated-init-in-header/file2.m.in.result new file mode 100644 index 000000000000..7465ed576f5f --- /dev/null +++ b/test/ARCMT/designated-init-in-header/file2.m.in.result @@ -0,0 +1,14 @@ +#include "header1.h" + +@implementation S1 +-(int)prop { return 0; } +-(void)setProp:(int)p {} ++(instancetype)s1 { return 0; } +-(instancetype)initWithFoo:(NSString*)foo +{ + self = [super init]; + if (self) { + } + return self; +} +@end diff --git a/test/ARCMT/designated-init-in-header/header1.h b/test/ARCMT/designated-init-in-header/header1.h new file mode 100644 index 000000000000..c5668cc46086 --- /dev/null +++ b/test/ARCMT/designated-init-in-header/header1.h @@ -0,0 +1,14 @@ +#define NS_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) + +@class NSString; + +@interface B1 +-(id)init; +@end + +@interface S1 : B1 +-(int)prop; +-(void)setProp:(int)p; ++(id)s1; +-(id)initWithFoo:(NSString*)foo; +@end diff --git a/test/ARCMT/designated-init-in-header/header1.h.result b/test/ARCMT/designated-init-in-header/header1.h.result new file mode 100644 index 000000000000..974175b1c3e6 --- /dev/null +++ b/test/ARCMT/designated-init-in-header/header1.h.result @@ -0,0 +1,13 @@ +#define NS_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) + +@class NSString; + +@interface B1 +-(instancetype)init; +@end + +@interface S1 : B1 +@property (nonatomic) int prop; ++(instancetype)s1; +-(instancetype)initWithFoo:(NSString*)foo NS_DESIGNATED_INITIALIZER; +@end diff --git a/test/ARCMT/init.m b/test/ARCMT/init.m index 9dbb1f82b828..b1f127e54fd1 100644 --- a/test/ARCMT/init.m +++ b/test/ARCMT/init.m @@ -1,7 +1,6 @@ // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -fobjc-arc -x objective-c %s.result // RUN: arcmt-test --args -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c %s > %t // RUN: diff %t %s.result -// DISABLE: mingw32 #define nil (void *)0 diff --git a/test/ARCMT/init.m.result b/test/ARCMT/init.m.result index d7f730083aab..d550dedb1dc1 100644 --- a/test/ARCMT/init.m.result +++ b/test/ARCMT/init.m.result @@ -1,7 +1,6 @@ // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -fobjc-arc -x objective-c %s.result // RUN: arcmt-test --args -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c %s > %t // RUN: diff %t %s.result -// DISABLE: mingw32 #define nil (void *)0 diff --git a/test/ARCMT/migrate-on-pch-and-module.m b/test/ARCMT/migrate-on-pch-and-module.m new file mode 100644 index 000000000000..c98ce467f6c7 --- /dev/null +++ b/test/ARCMT/migrate-on-pch-and-module.m @@ -0,0 +1,12 @@ +// RUN: rm -rf %t-mcp +// RUN: %clang_cc1 -objcmt-migrate-subscripting -emit-pch -o %t.pch %s -isysroot %S/Inputs/System -triple x86_64-apple-darwin10 -F %S/Inputs -fmodules -fmodules-cache-path=%t-mcp -w +// RUN: %clang_cc1 -objcmt-migrate-subscripting -include-pch %t.pch %s -migrate -o %t.remap -isysroot %S/Inputs/System -triple x86_64-apple-darwin10 -F %S/Inputs -fmodules -fmodules-cache-path=%t-mcp + +#ifndef HEADER +#define HEADER + +@import Module; + +#else + +#endif diff --git a/test/ARCMT/migrate-plist-output.m b/test/ARCMT/migrate-plist-output.m index 377dce30cafc..9b47b91d5809 100644 --- a/test/ARCMT/migrate-plist-output.m +++ b/test/ARCMT/migrate-plist-output.m @@ -49,4 +49,3 @@ void test(id p) { // CHECK: </dict> // CHECK: </plist> -// DISABLE: mingw32 diff --git a/test/ARCMT/migrate-space-in-path.m b/test/ARCMT/migrate-space-in-path.m index 89dfe1475cfe..a797e6d1f482 100644 --- a/test/ARCMT/migrate-space-in-path.m +++ b/test/ARCMT/migrate-space-in-path.m @@ -3,4 +3,3 @@ // RUN: %clang_cc1 -arcmt-migrate -mt-migrate-directory %t.migrate %S/"with space"/test2.m.in -x objective-c // RUN: c-arcmt-test -mt-migrate-directory %t.migrate | arcmt-test -verify-transformed-files %S/"with space"/test1.m.in.result %S/"with space"/test2.m.in.result %S/"with space"/test.h.result // RUN: rm -rf %t.migrate -// DISABLE: mingw32 diff --git a/test/ARCMT/migrate-with-pch.m b/test/ARCMT/migrate-with-pch.m index 7dca8be48844..1aafbdaf9b1e 100644 --- a/test/ARCMT/migrate-with-pch.m +++ b/test/ARCMT/migrate-with-pch.m @@ -4,4 +4,3 @@ // RUN: %clang_cc1 -arcmt-migrate -mt-migrate-directory %t %S/Inputs/test2.m.in -x objective-c -include-pch %t.pch // RUN: c-arcmt-test -mt-migrate-directory %t | arcmt-test -verify-transformed-files %S/Inputs/test1.m.in.result %S/Inputs/test2.m.in.result %S/Inputs/test.h.result // RUN: rm -rf %t -// DISABLE: mingw32 diff --git a/test/ARCMT/migrate.m b/test/ARCMT/migrate.m index 6f41258e59d6..d92cef7eb7cc 100644 --- a/test/ARCMT/migrate.m +++ b/test/ARCMT/migrate.m @@ -3,4 +3,3 @@ // RUN: %clang_cc1 -arcmt-migrate -mt-migrate-directory %t %S/Inputs/test2.m.in -x objective-c // RUN: c-arcmt-test -mt-migrate-directory %t | arcmt-test -verify-transformed-files %S/Inputs/test1.m.in.result %S/Inputs/test2.m.in.result %S/Inputs/test.h.result // RUN: rm -rf %t -// DISABLE: mingw32 diff --git a/test/ARCMT/no-canceling-bridge-to-bridge-cast.m b/test/ARCMT/no-canceling-bridge-to-bridge-cast.m index 81841fbf1e89..2c47822001e5 100644 --- a/test/ARCMT/no-canceling-bridge-to-bridge-cast.m +++ b/test/ARCMT/no-canceling-bridge-to-bridge-cast.m @@ -1,5 +1,4 @@ // RUN: %clang_cc1 -arcmt-check -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c -verify %s -// DISABLE: mingw32 // rdar://10387088 typedef const void * CFTypeRef; CFTypeRef CFBridgingRetain(id X); diff --git a/test/ARCMT/nonobjc-to-objc-cast-2.m b/test/ARCMT/nonobjc-to-objc-cast-2.m index e554c7da2d45..2b421b0757ad 100644 --- a/test/ARCMT/nonobjc-to-objc-cast-2.m +++ b/test/ARCMT/nonobjc-to-objc-cast-2.m @@ -1,5 +1,4 @@ // RUN: %clang_cc1 -arcmt-check -verify -triple x86_64-apple-darwin10 %s -// DISABLE: mingw32 #include "Common.h" diff --git a/test/ARCMT/nonobjc-to-objc-cast.m b/test/ARCMT/nonobjc-to-objc-cast.m index 55b6655fa404..b7d2a734b9c4 100644 --- a/test/ARCMT/nonobjc-to-objc-cast.m +++ b/test/ARCMT/nonobjc-to-objc-cast.m @@ -1,7 +1,6 @@ // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -fobjc-arc -x objective-c %s.result // RUN: arcmt-test --args -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c %s > %t // RUN: diff %t %s.result -// DISABLE: mingw32 #include "Common.h" diff --git a/test/ARCMT/nonobjc-to-objc-cast.m.result b/test/ARCMT/nonobjc-to-objc-cast.m.result index 4f508f6adfb6..ce827ba66aaf 100644 --- a/test/ARCMT/nonobjc-to-objc-cast.m.result +++ b/test/ARCMT/nonobjc-to-objc-cast.m.result @@ -1,7 +1,6 @@ // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -fobjc-arc -x objective-c %s.result // RUN: arcmt-test --args -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c %s > %t // RUN: diff %t %s.result -// DISABLE: mingw32 #include "Common.h" diff --git a/test/ARCMT/objcmt-arc-cf-annotations.m b/test/ARCMT/objcmt-arc-cf-annotations.m index 9772825b2934..c9a5b8215d10 100644 --- a/test/ARCMT/objcmt-arc-cf-annotations.m +++ b/test/ARCMT/objcmt-arc-cf-annotations.m @@ -360,7 +360,7 @@ CFAbsoluteTime f2() { NSDate* global_x; -// Test to see if we supresss an error when we store the pointer +// Test to see if we suppress an error when we store the pointer // to a global. CFAbsoluteTime f3() { @@ -528,38 +528,54 @@ void f15() { CFRelease(*B); // no-warning } -// Test when we pass NULL to CFRetain/CFRelease/CFMakeCollectable. +// Test when we pass NULL to CFRetain/CFRelease/CFMakeCollectable/CFAutorelease. void f16(int x, CFTypeRef p) { if (p) return; - if (x > 0) { - CFRelease(p); // expected-warning{{Null pointer argument in call to CFRelease}} - } - else if (x < 0) { - CFRetain(p); // expected-warning{{Null pointer argument in call to CFRetain}} - } - else { - CFMakeCollectable(p); // expected-warning{{Null pointer argument in call to CFMakeCollectable}} + switch (x) { + case 0: + CFRelease(p); + break; + case 1: + CFRetain(p); + break; + case 2: + CFMakeCollectable(p); + break; + case 3: + CFAutorelease(p); + break; + default: + break; } } -// Test that an object is non-null after being CFRetained/CFReleased. +// Test that an object is non-null after CFRetain/CFRelease/CFMakeCollectable/CFAutorelease. void f17(int x, CFTypeRef p) { - if (x > 0) { + switch (x) { + case 0: CFRelease(p); if (!p) CFRelease(0); // no-warning - } - else if (x < 0) { + break; + case 1: CFRetain(p); if (!p) CFRetain(0); // no-warning - } - else { + break; + case 2: CFMakeCollectable(p); if (!p) CFMakeCollectable(0); // no-warning + break; + case 3: + CFAutorelease(p); + if (!p) + CFAutorelease(0); // no-warning + break; + default: + break; } } diff --git a/test/ARCMT/objcmt-arc-cf-annotations.m.result b/test/ARCMT/objcmt-arc-cf-annotations.m.result index 7e0a9042f5e6..84bc43dcb5ca 100644 --- a/test/ARCMT/objcmt-arc-cf-annotations.m.result +++ b/test/ARCMT/objcmt-arc-cf-annotations.m.result @@ -390,7 +390,7 @@ CFAbsoluteTime f2() { NSDate* global_x; -// Test to see if we supresss an error when we store the pointer +// Test to see if we suppress an error when we store the pointer // to a global. CFAbsoluteTime f3() { @@ -570,38 +570,54 @@ void f15() { CFRelease(*B); // no-warning } -// Test when we pass NULL to CFRetain/CFRelease/CFMakeCollectable. +// Test when we pass NULL to CFRetain/CFRelease/CFMakeCollectable/CFAutorelease. void f16(int x, CFTypeRef p) { if (p) return; - if (x > 0) { - CFRelease(p); // expected-warning{{Null pointer argument in call to CFRelease}} - } - else if (x < 0) { - CFRetain(p); // expected-warning{{Null pointer argument in call to CFRetain}} - } - else { - CFMakeCollectable(p); // expected-warning{{Null pointer argument in call to CFMakeCollectable}} + switch (x) { + case 0: + CFRelease(p); + break; + case 1: + CFRetain(p); + break; + case 2: + CFMakeCollectable(p); + break; + case 3: + CFAutorelease(p); + break; + default: + break; } } -// Test that an object is non-null after being CFRetained/CFReleased. +// Test that an object is non-null after CFRetain/CFRelease/CFMakeCollectable/CFAutorelease. void f17(int x, CFTypeRef p) { - if (x > 0) { + switch (x) { + case 0: CFRelease(p); if (!p) CFRelease(0); // no-warning - } - else if (x < 0) { + break; + case 1: CFRetain(p); if (!p) CFRetain(0); // no-warning - } - else { + break; + case 2: CFMakeCollectable(p); if (!p) CFMakeCollectable(0); // no-warning + break; + case 3: + CFAutorelease(p); + if (!p) + CFAutorelease(0); // no-warning + break; + default: + break; } } diff --git a/test/ARCMT/objcmt-atomic-property.m.result b/test/ARCMT/objcmt-atomic-property.m.result index 1650cd23e3bd..3378ff1e487f 100644 --- a/test/ARCMT/objcmt-atomic-property.m.result +++ b/test/ARCMT/objcmt-atomic-property.m.result @@ -23,14 +23,14 @@ typedef char BOOL; } @property (weak) NSString *WeakProp; -@property (retain) NSString *StrongProp; +@property (strong) NSString *StrongProp; -@property (retain) NSString *UnavailProp __attribute__((unavailable)); +@property (strong) NSString *UnavailProp __attribute__((unavailable)); - (void) setUnavailProp : (NSString *)Val; -@property (retain) NSString *UnavailProp1 __attribute__((unavailable)); +@property (strong) NSString *UnavailProp1 __attribute__((unavailable)); -@property (retain) NSString *UnavailProp2; +@property (strong) NSString *UnavailProp2; - (void) setUnavailProp2 : (NSString *)Val __attribute__((unavailable)); @property (copy) NSDictionary *undoAction; @@ -48,10 +48,10 @@ typedef char BOOL; NSArray *_names3; NSArray *_names4; } -@property (retain) NSArray *names2; -@property (retain) NSArray *names3; -@property (retain) NSArray *names4; -@property (retain) NSArray *names1; +@property (strong) NSArray *names2; +@property (strong) NSArray *names3; +@property (strong) NSArray *names4; +@property (strong) NSArray *names1; @end // Properties that contain the name "delegate" or "dataSource", @@ -64,9 +64,9 @@ typedef char BOOL; @property (assign) id xxxdelegateYYY; -@property (retain) id MYtarget; +@property (strong) id MYtarget; -@property (retain) id targetX; +@property (strong) id targetX; @property int value; @@ -80,14 +80,14 @@ typedef char BOOL; - (void) Nothing; @property (readonly) int Length; -@property (readonly, retain) id object; +@property (readonly, strong) id object; + (double) D; @property (readonly) void *JSObject WEBKIT_OBJC_METHOD_ANNOTATION(AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER); @property (getter=isIgnoringInteractionEvents, readonly) BOOL ignoringInteractionEvents; -@property (getter=getStringValue, retain) NSString *stringValue; +@property (getter=getStringValue, strong) NSString *stringValue; @property (getter=getCounterValue, readonly) BOOL counterValue; -@property (getter=getns_dixtionary, readonly, retain) NSDictionary *ns_dixtionary; +@property (getter=getns_dixtionary, readonly, copy) NSDictionary *ns_dixtionary; - (BOOL)is3bar; // watch out - (NSString *)get3foo; // watch out @@ -108,9 +108,9 @@ typedef char BOOL; @property (assign) id xxxdelegateYYY; -@property (retain) id MYtarget; +@property (strong) id MYtarget; -@property (retain) id targetX; +@property (strong) id targetX; @property int value; @@ -124,7 +124,7 @@ typedef char BOOL; - (void) Nothing; @property (readonly) int Length; -@property (readonly, retain) id object; +@property (readonly, strong) id object; + (double) D; - (BOOL)is3bar; // watch out @@ -161,26 +161,26 @@ DEPRECATED @interface NSURL // Do not infer a property. -@property (retain) NSURL *appStoreReceiptURL NS_AVAILABLE; +@property (strong) NSURL *appStoreReceiptURL NS_AVAILABLE; - (void) setAppStoreReceiptURL : (NSURL *)object; -@property (retain) NSURL *appStoreReceiptURLX NS_AVAILABLE; +@property (strong) NSURL *appStoreReceiptURLX NS_AVAILABLE; // Do not infer a property. -@property (retain) NSURL *appStoreReceiptURLY ; +@property (strong) NSURL *appStoreReceiptURLY ; - (void) setAppStoreReceiptURLY : (NSURL *)object NS_AVAILABLE; -@property (readonly, retain) id OkToInfer NS_AVAILABLE; +@property (readonly, strong) id OkToInfer NS_AVAILABLE; // Do not infer a property. -@property (retain) NSURL *appStoreReceiptURLZ ; +@property (strong) NSURL *appStoreReceiptURLZ ; - (void) setAppStoreReceiptURLZ : (NSURL *)object NS_AVAILABLE; // Do not infer a property. - (id) t1 NORETURN NS_AVAILABLE; - (void) setT1 : (id) arg NS_AVAILABLE; -@property (retain) id method1 ALIGNED NS_AVAILABLE; +@property (strong) id method1 ALIGNED NS_AVAILABLE; - (NSURL *)init; // No Change + (id)alloc; // No Change diff --git a/test/ARCMT/objcmt-deprecated-category.m b/test/ARCMT/objcmt-deprecated-category.m deleted file mode 100644 index 5939e5a50ada..000000000000 --- a/test/ARCMT/objcmt-deprecated-category.m +++ /dev/null @@ -1,48 +0,0 @@ -// RUN: rm -rf %t -// RUN: %clang_cc1 -objcmt-migrate-annotation -mt-migrate-directory %t %s -x objective-c -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 %s.result -// rdar://15337661 - -#define DEPRECATED __attribute__((deprecated)) - -@interface NSArray -- (int)one; -@end - -@interface NSArray (NSDraggingSourceDeprecated) - -/* This method is unsafe because it could potentially cause buffer overruns. You should use -getObjects:range: instead. -*/ -- (void)getObjects:(id __unsafe_unretained [])objects; -- (void)dep_getObjects:(id __unsafe_unretained [])dep_objects DEPRECATED; - -@end - -@interface NSArray (NSDeprecated) - -/* This method is unsafe because it could potentially cause buffer overruns. You should use -getObjects:range: instead. -*/ -- (void)dep_getObjects:(id __unsafe_unretained [])dep_objects DEPRECATED; -- (void)getObjects:(id __unsafe_unretained [])objects; -@property int P1; -@property int P2 DEPRECATED; -@end - -@interface NSArray (DraggingSourceDeprecated) - -/* This method is unsafe because it could potentially cause buffer overruns. You should use -getObjects:range: instead. -*/ -- (void)getObjects:(id __unsafe_unretained [])objects; -- (void)dep_getObjects:(id __unsafe_unretained [])dep_objects DEPRECATED; -@property int P1; -@property int P2 DEPRECATED; - -@end - -@interface NSArray (Deprecated) -- (void)getObjects:(id __unsafe_unretained [])objects; -- (void)dep_getObjects:(id __unsafe_unretained [])dep_objects DEPRECATED; -@property int P1; -@property int P2 DEPRECATED; -@end diff --git a/test/ARCMT/objcmt-deprecated-category.m.result b/test/ARCMT/objcmt-deprecated-category.m.result deleted file mode 100644 index 3cb100044e46..000000000000 --- a/test/ARCMT/objcmt-deprecated-category.m.result +++ /dev/null @@ -1,48 +0,0 @@ -// RUN: rm -rf %t -// RUN: %clang_cc1 -objcmt-migrate-annotation -mt-migrate-directory %t %s -x objective-c -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 %s.result -// rdar://15337661 - -#define DEPRECATED __attribute__((deprecated)) - -@interface NSArray -- (int)one; -@end - -@interface NSArray (NSDraggingSourceDeprecated) - -/* This method is unsafe because it could potentially cause buffer overruns. You should use -getObjects:range: instead. -*/ -- (void)getObjects:(id __unsafe_unretained [])objects DEPRECATED; -- (void)dep_getObjects:(id __unsafe_unretained [])dep_objects DEPRECATED; - -@end - -@interface NSArray (NSDeprecated) - -/* This method is unsafe because it could potentially cause buffer overruns. You should use -getObjects:range: instead. -*/ -- (void)dep_getObjects:(id __unsafe_unretained [])dep_objects DEPRECATED; -- (void)getObjects:(id __unsafe_unretained [])objects DEPRECATED; -@property int P1 DEPRECATED; -@property int P2 DEPRECATED; -@end - -@interface NSArray (DraggingSourceDeprecated) - -/* This method is unsafe because it could potentially cause buffer overruns. You should use -getObjects:range: instead. -*/ -- (void)getObjects:(id __unsafe_unretained [])objects DEPRECATED; -- (void)dep_getObjects:(id __unsafe_unretained [])dep_objects DEPRECATED; -@property int P1 DEPRECATED; -@property int P2 DEPRECATED; - -@end - -@interface NSArray (Deprecated) -- (void)getObjects:(id __unsafe_unretained [])objects DEPRECATED; -- (void)dep_getObjects:(id __unsafe_unretained [])dep_objects DEPRECATED; -@property int P1 DEPRECATED; -@property int P2 DEPRECATED; -@end diff --git a/test/ARCMT/objcmt-designated-initializer.m b/test/ARCMT/objcmt-designated-initializer.m new file mode 100644 index 000000000000..279d4f35d8eb --- /dev/null +++ b/test/ARCMT/objcmt-designated-initializer.m @@ -0,0 +1,44 @@ +// RUN: rm -rf %t +// RUN: %clang_cc1 -objcmt-migrate-designated-init %s -triple x86_64-apple-darwin11 -fobjc-arc -migrate -o %t.remap +// RUN: c-arcmt-test %t.remap | arcmt-test -verify-transformed-files %s.result +// RUN: %clang_cc1 -triple x86_64-apple-darwin11 -fsyntax-only -x objective-c -fobjc-arc %s.result + +#define NS_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) + +@class NSString; + +@interface B1 +-(id)init; +@end + +@interface S1 : B1 +-(id)initWithFoo:(NSString*)foo; +@end + +@implementation S1 +-(id)initWithFoo:(NSString*)foo +{ + self = [super init]; + if (self) { + } + return self; +} +@end + +@interface B2 +-(id)init NS_DESIGNATED_INITIALIZER; +@end + +@interface S2 : B2 +-(id)init; +@end + +@implementation S2 +-(id)init +{ + self = [super init]; + if (self) { + } + return self; +} +@end diff --git a/test/ARCMT/objcmt-designated-initializer.m.result b/test/ARCMT/objcmt-designated-initializer.m.result new file mode 100644 index 000000000000..4c59b0cc5826 --- /dev/null +++ b/test/ARCMT/objcmt-designated-initializer.m.result @@ -0,0 +1,44 @@ +// RUN: rm -rf %t +// RUN: %clang_cc1 -objcmt-migrate-designated-init %s -triple x86_64-apple-darwin11 -fobjc-arc -migrate -o %t.remap +// RUN: c-arcmt-test %t.remap | arcmt-test -verify-transformed-files %s.result +// RUN: %clang_cc1 -triple x86_64-apple-darwin11 -fsyntax-only -x objective-c -fobjc-arc %s.result + +#define NS_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) + +@class NSString; + +@interface B1 +-(id)init; +@end + +@interface S1 : B1 +-(id)initWithFoo:(NSString*)foo NS_DESIGNATED_INITIALIZER; +@end + +@implementation S1 +-(id)initWithFoo:(NSString*)foo +{ + self = [super init]; + if (self) { + } + return self; +} +@end + +@interface B2 +-(id)init NS_DESIGNATED_INITIALIZER; +@end + +@interface S2 : B2 +-(id)init; +@end + +@implementation S2 +-(id)init +{ + self = [super init]; + if (self) { + } + return self; +} +@end diff --git a/test/ARCMT/objcmt-instancetype-2.m.result b/test/ARCMT/objcmt-instancetype-2.m.result index 8837e971ad27..7a32894f5706 100644 --- a/test/ARCMT/objcmt-instancetype-2.m.result +++ b/test/ARCMT/objcmt-instancetype-2.m.result @@ -16,10 +16,10 @@ typedef char BOOL; @class NSString, NSURL; @interface NSString (NSStringDeprecated) -+ (instancetype)stringWithContentsOfFile:(NSString *)path __attribute__((availability(macosx,introduced=10.0 ,message="" ))); -+ (instancetype)stringWithContentsOfURL:(NSURL *)url __attribute__((availability(macosx,introduced=10.0 ,message="" ))); -+ (instancetype)stringWithCString:(const char *)bytes length:(NSUInteger)length __attribute__((availability(macosx,introduced=10.0 ,message="" ))); -+ (instancetype)stringWithCString:(const char *)bytes __attribute__((availability(macosx,introduced=10.0 ,message="" ))); ++ (id)stringWithContentsOfFile:(NSString *)path __attribute__((availability(macosx,introduced=10.0 ,message="" ))); ++ (id)stringWithContentsOfURL:(NSURL *)url __attribute__((availability(macosx,introduced=10.0 ,message="" ))); ++ (id)stringWithCString:(const char *)bytes length:(NSUInteger)length __attribute__((availability(macosx,introduced=10.0 ,message="" ))); ++ (id)stringWithCString:(const char *)bytes __attribute__((availability(macosx,introduced=10.0 ,message="" ))); @end diff --git a/test/ARCMT/objcmt-instancetype-unnecessary-diff.m b/test/ARCMT/objcmt-instancetype-unnecessary-diff.m new file mode 100644 index 000000000000..e250bb0956c0 --- /dev/null +++ b/test/ARCMT/objcmt-instancetype-unnecessary-diff.m @@ -0,0 +1,10 @@ +// RUN: %clang_cc1 -objcmt-migrate-instancetype %s -triple x86_64-apple-darwin11 -fobjc-arc -migrate -o %t.remap +// RUN: FileCheck %s -input-file=%t.remap + +// Make sure we don't create an edit unnecessarily. +// CHECK-NOT: instancetype + +@class NSString; +@interface NSDictionary ++(instancetype) dictionaryWithURLEncodedString:(NSString *)urlEncodedString; +@end diff --git a/test/ARCMT/objcmt-ns-nonatomic-iosonly.m.result b/test/ARCMT/objcmt-ns-nonatomic-iosonly.m.result index 804142ee3280..8e9e3a0c21ca 100644 --- a/test/ARCMT/objcmt-ns-nonatomic-iosonly.m.result +++ b/test/ARCMT/objcmt-ns-nonatomic-iosonly.m.result @@ -30,14 +30,14 @@ typedef char BOOL; } @property (NS_NONATOMIC_IOSONLY, weak) NSString *WeakProp; -@property (NS_NONATOMIC_IOSONLY, retain) NSString *StrongProp; +@property (NS_NONATOMIC_IOSONLY, strong) NSString *StrongProp; -@property (NS_NONATOMIC_IOSONLY, retain) NSString *UnavailProp __attribute__((unavailable)); +@property (NS_NONATOMIC_IOSONLY, strong) NSString *UnavailProp __attribute__((unavailable)); - (void) setUnavailProp : (NSString *)Val; -@property (NS_NONATOMIC_IOSONLY, retain) NSString *UnavailProp1 __attribute__((unavailable)); +@property (NS_NONATOMIC_IOSONLY, strong) NSString *UnavailProp1 __attribute__((unavailable)); -@property (NS_NONATOMIC_IOSONLY, retain) NSString *UnavailProp2; +@property (NS_NONATOMIC_IOSONLY, strong) NSString *UnavailProp2; - (void) setUnavailProp2 : (NSString *)Val __attribute__((unavailable)); @property (NS_NONATOMIC_IOSONLY, copy) NSDictionary *undoAction; @@ -55,10 +55,10 @@ typedef char BOOL; NSArray *_names3; NSArray *_names4; } -@property (NS_NONATOMIC_IOSONLY, retain) NSArray *names2; -@property (NS_NONATOMIC_IOSONLY, retain) NSArray *names3; -@property (NS_NONATOMIC_IOSONLY, retain) NSArray *names4; -@property (NS_NONATOMIC_IOSONLY, retain) NSArray *names1; +@property (NS_NONATOMIC_IOSONLY, strong) NSArray *names2; +@property (NS_NONATOMIC_IOSONLY, strong) NSArray *names3; +@property (NS_NONATOMIC_IOSONLY, strong) NSArray *names4; +@property (NS_NONATOMIC_IOSONLY, strong) NSArray *names1; @end // Properties that contain the name "delegate" or "dataSource", @@ -71,9 +71,9 @@ typedef char BOOL; @property (NS_NONATOMIC_IOSONLY, assign) id xxxdelegateYYY; -@property (NS_NONATOMIC_IOSONLY, retain) id MYtarget; +@property (NS_NONATOMIC_IOSONLY, strong) id MYtarget; -@property (NS_NONATOMIC_IOSONLY, retain) id targetX; +@property (NS_NONATOMIC_IOSONLY, strong) id targetX; @property (NS_NONATOMIC_IOSONLY) int value; @@ -87,14 +87,14 @@ typedef char BOOL; - (void) Nothing; @property (NS_NONATOMIC_IOSONLY, readonly) int Length; -@property (NS_NONATOMIC_IOSONLY, readonly, retain) id object; +@property (NS_NONATOMIC_IOSONLY, readonly, strong) id object; + (double) D; @property (NS_NONATOMIC_IOSONLY, readonly) void *JSObject WEBKIT_OBJC_METHOD_ANNOTATION(AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER); @property (NS_NONATOMIC_IOSONLY, getter=isIgnoringInteractionEvents, readonly) BOOL ignoringInteractionEvents; -@property (NS_NONATOMIC_IOSONLY, getter=getStringValue, retain) NSString *stringValue; +@property (NS_NONATOMIC_IOSONLY, getter=getStringValue, strong) NSString *stringValue; @property (NS_NONATOMIC_IOSONLY, getter=getCounterValue, readonly) BOOL counterValue; -@property (NS_NONATOMIC_IOSONLY, getter=getns_dixtionary, readonly, retain) NSDictionary *ns_dixtionary; +@property (NS_NONATOMIC_IOSONLY, getter=getns_dixtionary, readonly, copy) NSDictionary *ns_dixtionary; - (BOOL)is3bar; // watch out - (NSString *)get3foo; // watch out @@ -115,9 +115,9 @@ typedef char BOOL; @property (NS_NONATOMIC_IOSONLY, assign) id xxxdelegateYYY; -@property (NS_NONATOMIC_IOSONLY, retain) id MYtarget; +@property (NS_NONATOMIC_IOSONLY, strong) id MYtarget; -@property (NS_NONATOMIC_IOSONLY, retain) id targetX; +@property (NS_NONATOMIC_IOSONLY, strong) id targetX; @property (NS_NONATOMIC_IOSONLY) int value; @@ -131,7 +131,7 @@ typedef char BOOL; - (void) Nothing; @property (NS_NONATOMIC_IOSONLY, readonly) int Length; -@property (NS_NONATOMIC_IOSONLY, readonly, retain) id object; +@property (NS_NONATOMIC_IOSONLY, readonly, strong) id object; + (double) D; - (BOOL)is3bar; // watch out @@ -168,26 +168,26 @@ DEPRECATED @interface NSURL // Do not infer a property. -@property (NS_NONATOMIC_IOSONLY, retain) NSURL *appStoreReceiptURL NS_AVAILABLE; +@property (NS_NONATOMIC_IOSONLY, strong) NSURL *appStoreReceiptURL NS_AVAILABLE; - (void) setAppStoreReceiptURL : (NSURL *)object; -@property (NS_NONATOMIC_IOSONLY, retain) NSURL *appStoreReceiptURLX NS_AVAILABLE; +@property (NS_NONATOMIC_IOSONLY, strong) NSURL *appStoreReceiptURLX NS_AVAILABLE; // Do not infer a property. -@property (NS_NONATOMIC_IOSONLY, retain) NSURL *appStoreReceiptURLY ; +@property (NS_NONATOMIC_IOSONLY, strong) NSURL *appStoreReceiptURLY ; - (void) setAppStoreReceiptURLY : (NSURL *)object NS_AVAILABLE; -@property (NS_NONATOMIC_IOSONLY, readonly, retain) id OkToInfer NS_AVAILABLE; +@property (NS_NONATOMIC_IOSONLY, readonly, strong) id OkToInfer NS_AVAILABLE; // Do not infer a property. -@property (NS_NONATOMIC_IOSONLY, retain) NSURL *appStoreReceiptURLZ ; +@property (NS_NONATOMIC_IOSONLY, strong) NSURL *appStoreReceiptURLZ ; - (void) setAppStoreReceiptURLZ : (NSURL *)object NS_AVAILABLE; // Do not infer a property. - (id) t1 NORETURN NS_AVAILABLE; - (void) setT1 : (id) arg NS_AVAILABLE; -@property (NS_NONATOMIC_IOSONLY, retain) id method1 ALIGNED NS_AVAILABLE; +@property (NS_NONATOMIC_IOSONLY, strong) id method1 ALIGNED NS_AVAILABLE; - (NSURL *)init; // No Change + (id)alloc; // No Change diff --git a/test/ARCMT/objcmt-property-availability.m.result b/test/ARCMT/objcmt-property-availability.m.result index 681f9a99bf55..a5a45e37929c 100644 --- a/test/ARCMT/objcmt-property-availability.m.result +++ b/test/ARCMT/objcmt-property-availability.m.result @@ -19,20 +19,20 @@ #define UNAVAILABLE __attribute__((unavailable("not available in automatic reference counting mode"))) @interface MKMapItem -@property (nonatomic, retain) MKMapItem *source NS_AVAILABLE(10_9, 6_0); +@property (nonatomic, strong) MKMapItem *source NS_AVAILABLE(10_9, 6_0); - (void)setSource:(MKMapItem *)source NS_AVAILABLE(10_9, 7_0); -@property (nonatomic, retain) MKMapItem *dest NS_AVAILABLE(10_9, 6_0); +@property (nonatomic, strong) MKMapItem *dest NS_AVAILABLE(10_9, 6_0); -@property (nonatomic, retain) MKMapItem *final; +@property (nonatomic, strong) MKMapItem *final; -@property (nonatomic, retain) MKMapItem *total NS_AVAILABLE(10_9, 6_0); +@property (nonatomic, strong) MKMapItem *total NS_AVAILABLE(10_9, 6_0); - (void)setTotal:(MKMapItem *)source; - (MKMapItem *)comp NS_AVAILABLE(10_9, 6_0); - (void)setComp:(MKMapItem *)source UNAVAILABLE; -@property (nonatomic, retain) MKMapItem *tally UNAVAILABLE NS_AVAILABLE(10_9, 6_0); +@property (nonatomic, strong) MKMapItem *tally UNAVAILABLE NS_AVAILABLE(10_9, 6_0); - (MKMapItem *)itally NS_AVAILABLE(10_9, 6_0); - (void)setItally:(MKMapItem *)source UNAVAILABLE NS_AVAILABLE(10_9, 6_0); diff --git a/test/ARCMT/objcmt-property.m b/test/ARCMT/objcmt-property.m index 3b77aadb892b..61739efe0ab2 100644 --- a/test/ARCMT/objcmt-property.m +++ b/test/ARCMT/objcmt-property.m @@ -70,6 +70,9 @@ typedef char BOOL; - (id) dataSource; +// rdar://15509831 +- (id)delegate; + - (id)xxxdelegateYYY; - (void)setXxxdelegateYYY:(id)delegate; diff --git a/test/ARCMT/objcmt-property.m.result b/test/ARCMT/objcmt-property.m.result index c6380c80523f..ec4ac85127ef 100644 --- a/test/ARCMT/objcmt-property.m.result +++ b/test/ARCMT/objcmt-property.m.result @@ -23,14 +23,14 @@ typedef char BOOL; } @property (nonatomic, weak) NSString *WeakProp; -@property (nonatomic, retain) NSString *StrongProp; +@property (nonatomic, strong) NSString *StrongProp; -@property (nonatomic, retain) NSString *UnavailProp __attribute__((unavailable)); +@property (nonatomic, strong) NSString *UnavailProp __attribute__((unavailable)); - (void) setUnavailProp : (NSString *)Val; -@property (nonatomic, retain) NSString *UnavailProp1 __attribute__((unavailable)); +@property (nonatomic, strong) NSString *UnavailProp1 __attribute__((unavailable)); -@property (nonatomic, retain) NSString *UnavailProp2; +@property (nonatomic, strong) NSString *UnavailProp2; - (void) setUnavailProp2 : (NSString *)Val __attribute__((unavailable)); @property (nonatomic, copy) NSDictionary *undoAction; @@ -48,10 +48,10 @@ typedef char BOOL; NSArray *_names3; NSArray *_names4; } -@property (nonatomic, retain) NSArray *names2; -@property (nonatomic, retain) NSArray *names3; -@property (nonatomic, retain) NSArray *names4; -@property (nonatomic, retain) NSArray *names1; +@property (nonatomic, strong) NSArray *names2; +@property (nonatomic, strong) NSArray *names3; +@property (nonatomic, strong) NSArray *names4; +@property (nonatomic, strong) NSArray *names1; @end // Properties that contain the name "delegate" or "dataSource", @@ -61,12 +61,15 @@ typedef char BOOL; @property (nonatomic, assign) id dataSource; +// rdar://15509831 +@property (nonatomic, readonly, assign) id delegate; + @property (nonatomic, assign) id xxxdelegateYYY; -@property (nonatomic, retain) id MYtarget; +@property (nonatomic, strong) id MYtarget; -@property (nonatomic, retain) id targetX; +@property (nonatomic, strong) id targetX; @property (nonatomic) int value; @@ -80,14 +83,14 @@ typedef char BOOL; - (void) Nothing; @property (nonatomic, readonly) int Length; -@property (nonatomic, readonly, retain) id object; +@property (nonatomic, readonly, strong) id object; + (double) D; @property (nonatomic, readonly) void *JSObject WEBKIT_OBJC_METHOD_ANNOTATION(AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER); @property (nonatomic, getter=isIgnoringInteractionEvents, readonly) BOOL ignoringInteractionEvents; -@property (nonatomic, getter=getStringValue, retain) NSString *stringValue; +@property (nonatomic, getter=getStringValue, strong) NSString *stringValue; @property (nonatomic, getter=getCounterValue, readonly) BOOL counterValue; -@property (nonatomic, getter=getns_dixtionary, readonly, retain) NSDictionary *ns_dixtionary; +@property (nonatomic, getter=getns_dixtionary, readonly, copy) NSDictionary *ns_dixtionary; - (BOOL)is3bar; // watch out - (NSString *)get3foo; // watch out @@ -108,9 +111,9 @@ typedef char BOOL; @property (nonatomic, assign) id xxxdelegateYYY; -@property (nonatomic, retain) id MYtarget; +@property (nonatomic, strong) id MYtarget; -@property (nonatomic, retain) id targetX; +@property (nonatomic, strong) id targetX; @property (nonatomic) int value; @@ -124,7 +127,7 @@ typedef char BOOL; - (void) Nothing; @property (nonatomic, readonly) int Length; -@property (nonatomic, readonly, retain) id object; +@property (nonatomic, readonly, strong) id object; + (double) D; - (BOOL)is3bar; // watch out @@ -161,26 +164,26 @@ DEPRECATED @interface NSURL // Do not infer a property. -@property (nonatomic, retain) NSURL *appStoreReceiptURL NS_AVAILABLE; +@property (nonatomic, strong) NSURL *appStoreReceiptURL NS_AVAILABLE; - (void) setAppStoreReceiptURL : (NSURL *)object; -@property (nonatomic, retain) NSURL *appStoreReceiptURLX NS_AVAILABLE; +@property (nonatomic, strong) NSURL *appStoreReceiptURLX NS_AVAILABLE; // Do not infer a property. -@property (nonatomic, retain) NSURL *appStoreReceiptURLY ; +@property (nonatomic, strong) NSURL *appStoreReceiptURLY ; - (void) setAppStoreReceiptURLY : (NSURL *)object NS_AVAILABLE; -@property (nonatomic, readonly, retain) id OkToInfer NS_AVAILABLE; +@property (nonatomic, readonly, strong) id OkToInfer NS_AVAILABLE; // Do not infer a property. -@property (nonatomic, retain) NSURL *appStoreReceiptURLZ ; +@property (nonatomic, strong) NSURL *appStoreReceiptURLZ ; - (void) setAppStoreReceiptURLZ : (NSURL *)object NS_AVAILABLE; // Do not infer a property. - (id) t1 NORETURN NS_AVAILABLE; - (void) setT1 : (id) arg NS_AVAILABLE; -@property (nonatomic, retain) id method1 ALIGNED NS_AVAILABLE; +@property (nonatomic, strong) id method1 ALIGNED NS_AVAILABLE; - (NSURL *)init; // No Change + (id)alloc; // No Change diff --git a/test/ARCMT/objcmt-protocol-conformance.m b/test/ARCMT/objcmt-protocol-conformance.m index 7bc7d938177f..f4c8f5112a62 100644 --- a/test/ARCMT/objcmt-protocol-conformance.m +++ b/test/ARCMT/objcmt-protocol-conformance.m @@ -112,3 +112,19 @@ @implementation Test7 @end +// rdar://15515206 +@interface BTLEBrowser +@end + +@protocol CBCentralManagerDelegate; + +@protocol CBCentralManagerDelegate +- (id) Meth1: (double) arg; +@end + +@interface BTLEBrowser() <CBCentralManagerDelegate> +@end + +@implementation BTLEBrowser +- (id) Meth15515206: (double) arg { return 0; } +@end diff --git a/test/ARCMT/objcmt-protocol-conformance.m.result b/test/ARCMT/objcmt-protocol-conformance.m.result index dc0874c88f22..0322ab81d6af 100644 --- a/test/ARCMT/objcmt-protocol-conformance.m.result +++ b/test/ARCMT/objcmt-protocol-conformance.m.result @@ -112,3 +112,19 @@ @implementation Test7 @end +// rdar://15515206 +@interface BTLEBrowser +@end + +@protocol CBCentralManagerDelegate; + +@protocol CBCentralManagerDelegate +- (id) Meth1: (double) arg; +@end + +@interface BTLEBrowser() <CBCentralManagerDelegate> +@end + +@implementation BTLEBrowser +- (id) Meth15515206: (double) arg { return 0; } +@end diff --git a/test/ARCMT/protected-scope.m b/test/ARCMT/protected-scope.m index 8aece44d4ffa..b522f54cdf7c 100644 --- a/test/ARCMT/protected-scope.m +++ b/test/ARCMT/protected-scope.m @@ -1,7 +1,6 @@ // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -fobjc-arc -x objective-c %s.result // RUN: arcmt-test --args -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c %s > %t // RUN: diff %t %s.result -// DISABLE: mingw32 #include "Common.h" diff --git a/test/ARCMT/protected-scope.m.result b/test/ARCMT/protected-scope.m.result index f385d8825de5..55070f273227 100644 --- a/test/ARCMT/protected-scope.m.result +++ b/test/ARCMT/protected-scope.m.result @@ -1,7 +1,6 @@ // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -fobjc-arc -x objective-c %s.result // RUN: arcmt-test --args -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c %s > %t // RUN: diff %t %s.result -// DISABLE: mingw32 #include "Common.h" diff --git a/test/ARCMT/whitelisted/header1.h b/test/ARCMT/whitelisted/header1.h index a3014eb5b653..d94b9f7d9ebe 100644 --- a/test/ARCMT/whitelisted/header1.h +++ b/test/ARCMT/whitelisted/header1.h @@ -2,4 +2,5 @@ @interface I1 : NSObject -(int)prop; -(void)setProp:(int)p; ++(id)i1; @end diff --git a/test/ARCMT/whitelisted/header1.h.result b/test/ARCMT/whitelisted/header1.h.result index 7808fc8a6a3f..65cbd2621f6b 100644 --- a/test/ARCMT/whitelisted/header1.h.result +++ b/test/ARCMT/whitelisted/header1.h.result @@ -1,4 +1,5 @@ @interface I1 : NSObject @property (nonatomic) int prop; ++(instancetype)i1; @end diff --git a/test/ARCMT/whitelisted/objcmt-with-whitelist-impl.m b/test/ARCMT/whitelisted/objcmt-with-whitelist-impl.m new file mode 100644 index 000000000000..d734eaa10bdf --- /dev/null +++ b/test/ARCMT/whitelisted/objcmt-with-whitelist-impl.m @@ -0,0 +1,18 @@ +// RUN: rm -rf %t +// RUN: %clang_cc1 -objcmt-migrate-readwrite-property -objcmt-migrate-instancetype -objcmt-white-list-dir-path=%S/Inputs %s -triple x86_64-apple-darwin11 -migrate -o %t.remap +// RUN: c-arcmt-test %t.remap | arcmt-test -verify-transformed-files %S/header1.h.result %s.result + +@interface NSObject ++ (id)alloc; +@end + +#include "header1.h" +#include "header2.h" + +@interface I2(cat) +-(id)initInCat; +@end + +@implementation I1 ++(id)i1 {} +@end diff --git a/test/ARCMT/whitelisted/objcmt-with-whitelist-impl.m.result b/test/ARCMT/whitelisted/objcmt-with-whitelist-impl.m.result new file mode 100644 index 000000000000..b936b52b729b --- /dev/null +++ b/test/ARCMT/whitelisted/objcmt-with-whitelist-impl.m.result @@ -0,0 +1,18 @@ +// RUN: rm -rf %t +// RUN: %clang_cc1 -objcmt-migrate-readwrite-property -objcmt-migrate-instancetype -objcmt-white-list-dir-path=%S/Inputs %s -triple x86_64-apple-darwin11 -migrate -o %t.remap +// RUN: c-arcmt-test %t.remap | arcmt-test -verify-transformed-files %S/header1.h.result %s.result + +@interface NSObject ++ (id)alloc; +@end + +#include "header1.h" +#include "header2.h" + +@interface I2(cat) +-(id)initInCat; +@end + +@implementation I1 ++(instancetype)i1 {} +@end diff --git a/test/ARCMT/whitelisted/objcmt-with-whitelist.m b/test/ARCMT/whitelisted/objcmt-with-whitelist.m index 1b44c9a6d9fe..bef82c8667d9 100644 --- a/test/ARCMT/whitelisted/objcmt-with-whitelist.m +++ b/test/ARCMT/whitelisted/objcmt-with-whitelist.m @@ -1,7 +1,7 @@ // RUN: rm -rf %t -// RUN: %clang_cc1 -objcmt-migrate-readwrite-property %s -triple x86_64-apple-darwin11 -migrate -o %t.remap +// RUN: %clang_cc1 -objcmt-migrate-readwrite-property -objcmt-migrate-instancetype %s -triple x86_64-apple-darwin11 -migrate -o %t.remap // RUN: c-arcmt-test %t.remap | arcmt-test -verify-transformed-files %S/header1.h.result %S/header2.h.result -// RUN: %clang_cc1 -objcmt-migrate-readwrite-property -objcmt-white-list-dir-path=%S/Inputs %s -triple x86_64-apple-darwin11 -migrate -o %t.remap +// RUN: %clang_cc1 -objcmt-migrate-readwrite-property -objcmt-migrate-instancetype -objcmt-white-list-dir-path=%S/Inputs %s -triple x86_64-apple-darwin11 -migrate -o %t.remap // RUN: c-arcmt-test %t.remap | arcmt-test -verify-transformed-files %S/header1.h.result @interface NSObject |