summaryrefslogtreecommitdiffstats
path: root/third_party/python/gyp/test/mac/objc-arc
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/python/gyp/test/mac/objc-arc')
-rw-r--r--third_party/python/gyp/test/mac/objc-arc/c-file.c5
-rw-r--r--third_party/python/gyp/test/mac/objc-arc/cc-file.cc5
-rw-r--r--third_party/python/gyp/test/mac/objc-arc/m-file-arc-weak.m9
-rw-r--r--third_party/python/gyp/test/mac/objc-arc/m-file-no-arc.m9
-rw-r--r--third_party/python/gyp/test/mac/objc-arc/m-file.m9
-rw-r--r--third_party/python/gyp/test/mac/objc-arc/mm-file-arc-weak.mm9
-rw-r--r--third_party/python/gyp/test/mac/objc-arc/mm-file-no-arc.mm9
-rw-r--r--third_party/python/gyp/test/mac/objc-arc/mm-file.mm9
-rw-r--r--third_party/python/gyp/test/mac/objc-arc/test.gyp53
9 files changed, 117 insertions, 0 deletions
diff --git a/third_party/python/gyp/test/mac/objc-arc/c-file.c b/third_party/python/gyp/test/mac/objc-arc/c-file.c
new file mode 100644
index 0000000000..208935946f
--- /dev/null
+++ b/third_party/python/gyp/test/mac/objc-arc/c-file.c
@@ -0,0 +1,5 @@
+#if __has_feature(objc_arc) || __has_feature(objc_arc_weak)
+#error "C files shouldn't be ARC'd!"
+#endif
+
+void c_fun() {}
diff --git a/third_party/python/gyp/test/mac/objc-arc/cc-file.cc b/third_party/python/gyp/test/mac/objc-arc/cc-file.cc
new file mode 100644
index 0000000000..70deb60b9a
--- /dev/null
+++ b/third_party/python/gyp/test/mac/objc-arc/cc-file.cc
@@ -0,0 +1,5 @@
+#if __has_feature(objc_arc) || __has_feature(objc_arc_weak)
+#error "C++ files shouldn't be ARC'd!"
+#endif
+
+void cc_fun() {}
diff --git a/third_party/python/gyp/test/mac/objc-arc/m-file-arc-weak.m b/third_party/python/gyp/test/mac/objc-arc/m-file-arc-weak.m
new file mode 100644
index 0000000000..4ab7c51a82
--- /dev/null
+++ b/third_party/python/gyp/test/mac/objc-arc/m-file-arc-weak.m
@@ -0,0 +1,9 @@
+#if __has_feature(objc_arc)
+#error "ObjC files without CLANG_ENABLE_OBJC_ARC should not be ARC'd!"
+#endif
+
+#if !__has_feature(objc_arc_weak)
+#error "With CLANG_ENABLE_OBJC_WEAK, weak references should be enabled."
+#endif
+
+void m_fun() {}
diff --git a/third_party/python/gyp/test/mac/objc-arc/m-file-no-arc.m b/third_party/python/gyp/test/mac/objc-arc/m-file-no-arc.m
new file mode 100644
index 0000000000..4f067abb67
--- /dev/null
+++ b/third_party/python/gyp/test/mac/objc-arc/m-file-no-arc.m
@@ -0,0 +1,9 @@
+#if __has_feature(objc_arc)
+#error "ObjC files without CLANG_ENABLE_OBJC_ARC should not be ARC'd!"
+#endif
+
+#if __has_feature(objc_arc_weak)
+#error "Without CLANG_ENABLE_OBJC_WEAK, weak references should be disabled."
+#endif
+
+void m_fun() {}
diff --git a/third_party/python/gyp/test/mac/objc-arc/m-file.m b/third_party/python/gyp/test/mac/objc-arc/m-file.m
new file mode 100644
index 0000000000..8234ba582d
--- /dev/null
+++ b/third_party/python/gyp/test/mac/objc-arc/m-file.m
@@ -0,0 +1,9 @@
+#if !__has_feature(objc_arc)
+#error "ObjC files with CLANG_ENABLE_OBJC_ARC should be ARC'd!"
+#endif
+
+#if !__has_feature(objc_arc_weak)
+#error "Weak references should always be enabled for ARC."
+#endif
+
+void m_fun() {}
diff --git a/third_party/python/gyp/test/mac/objc-arc/mm-file-arc-weak.mm b/third_party/python/gyp/test/mac/objc-arc/mm-file-arc-weak.mm
new file mode 100644
index 0000000000..f9d4b6759a
--- /dev/null
+++ b/third_party/python/gyp/test/mac/objc-arc/mm-file-arc-weak.mm
@@ -0,0 +1,9 @@
+#if __has_feature(objc_arc)
+#error "ObjC++ files without CLANG_ENABLE_OBJC_ARC should not be ARC'd!"
+#endif
+
+#if !__has_feature(objc_arc_weak)
+#error "With CLANG_ENABLE_OBJC_WEAK, weak references should be enabled."
+#endif
+
+void mm_fun() {}
diff --git a/third_party/python/gyp/test/mac/objc-arc/mm-file-no-arc.mm b/third_party/python/gyp/test/mac/objc-arc/mm-file-no-arc.mm
new file mode 100644
index 0000000000..823f52feba
--- /dev/null
+++ b/third_party/python/gyp/test/mac/objc-arc/mm-file-no-arc.mm
@@ -0,0 +1,9 @@
+#if __has_feature(objc_arc)
+#error "ObjC++ files without CLANG_ENABLE_OBJC_ARC should not be ARC'd!"
+#endif
+
+#if __has_feature(objc_arc_weak)
+#error "Without CLANG_ENABLE_OBJC_WEAK, weak references should be disabled."
+#endif
+
+void mm_fun() {}
diff --git a/third_party/python/gyp/test/mac/objc-arc/mm-file.mm b/third_party/python/gyp/test/mac/objc-arc/mm-file.mm
new file mode 100644
index 0000000000..90150ef0b6
--- /dev/null
+++ b/third_party/python/gyp/test/mac/objc-arc/mm-file.mm
@@ -0,0 +1,9 @@
+#if !__has_feature(objc_arc)
+#error "ObjC++ files with CLANG_ENABLE_OBJC_ARC should be ARC'd!"
+#endif
+
+#if !__has_feature(objc_arc_weak)
+#error "Weak references should always be enabled for ARC."
+#endif
+
+void mm_fun() {}
diff --git a/third_party/python/gyp/test/mac/objc-arc/test.gyp b/third_party/python/gyp/test/mac/objc-arc/test.gyp
new file mode 100644
index 0000000000..87ddda962e
--- /dev/null
+++ b/third_party/python/gyp/test/mac/objc-arc/test.gyp
@@ -0,0 +1,53 @@
+# Copyright (c) 2013 Google Inc. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+{
+ 'make_global_settings': [
+ ['CC', '/usr/bin/clang'],
+ ['CXX', '/usr/bin/clang++'],
+ ],
+
+ 'targets': [
+ {
+ 'target_name': 'arc_enabled',
+ 'type': 'static_library',
+ 'sources': [
+ 'c-file.c',
+ 'cc-file.cc',
+ 'm-file.m',
+ 'mm-file.mm',
+ ],
+ 'xcode_settings': {
+ 'CLANG_ENABLE_OBJC_ARC': 'YES',
+ },
+ },
+
+ {
+ 'target_name': 'weak_enabled',
+ 'type': 'static_library',
+ 'sources': [
+ 'c-file.c',
+ 'cc-file.cc',
+ 'm-file-arc-weak.m',
+ 'mm-file-arc-weak.mm',
+ ],
+ 'xcode_settings': {
+ 'CLANG_ENABLE_OBJC_WEAK': 'YES',
+ },
+ },
+
+ {
+ 'target_name': 'arc_disabled',
+ 'type': 'static_library',
+ 'sources': [
+ 'c-file.c',
+ 'cc-file.cc',
+ 'm-file-no-arc.m',
+ 'mm-file-no-arc.mm',
+ ],
+ 'xcode_settings': {
+ },
+ },
+ ],
+}
+