aboutsummaryrefslogtreecommitdiff
path: root/test/SemaObjC/attr-deprecated-pch.m
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaObjC/attr-deprecated-pch.m')
-rw-r--r--test/SemaObjC/attr-deprecated-pch.m23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/SemaObjC/attr-deprecated-pch.m b/test/SemaObjC/attr-deprecated-pch.m
new file mode 100644
index 000000000000..2b48aea379a0
--- /dev/null
+++ b/test/SemaObjC/attr-deprecated-pch.m
@@ -0,0 +1,23 @@
+// RUN: %clang_cc1 -fsyntax-only -DBOTH -verify %s
+// If the decls come from a pch, the behavior shouldn't change:
+// RUN: %clang_cc1 -x objective-c-header %s -emit-pch -o %t
+// RUN: %clang_cc1 -DUSES -include-pch %t -fsyntax-only -verify %s
+// expected-no-diagnostics
+
+// The slightly strange ifdefs are so that the command that builds the gch file
+// doesn't need any -D switches, for these would get embedded in the gch.
+
+#ifndef USES
+@interface Interface1
+- (void)partiallyUnavailableMethod;
+@end
+@interface Interface2
+- (void)partiallyUnavailableMethod __attribute__((unavailable));
+@end
+#endif
+
+#if defined(USES) || defined(BOTH)
+void f(id a) {
+ [a partiallyUnavailableMethod]; // no warning, `a` could be an Interface1.
+}
+#endif