xref: /aosp_15_r20/external/clang/test/SemaObjC/attr-deprecated-pch.m (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li// RUN: %clang_cc1 -fsyntax-only -DBOTH -verify %s
2*67e74705SXin Li// If the decls come from a pch, the behavior shouldn't change:
3*67e74705SXin Li// RUN: %clang_cc1 -x objective-c-header %s -emit-pch -o %t
4*67e74705SXin Li// RUN: %clang_cc1 -DUSES -include-pch %t -fsyntax-only -verify %s
5*67e74705SXin Li// expected-no-diagnostics
6*67e74705SXin Li
7*67e74705SXin Li// The slightly strange ifdefs are so that the command that builds the gch file
8*67e74705SXin Li// doesn't need any -D switches, for these would get embedded in the gch.
9*67e74705SXin Li
10*67e74705SXin Li#ifndef USES
11*67e74705SXin Li@interface Interface1
12*67e74705SXin Li- (void)partiallyUnavailableMethod;
13*67e74705SXin Li@end
14*67e74705SXin Li@interface Interface2
15*67e74705SXin Li- (void)partiallyUnavailableMethod __attribute__((unavailable));
16*67e74705SXin Li@end
17*67e74705SXin Li#endif
18*67e74705SXin Li
19*67e74705SXin Li#if defined(USES) || defined(BOTH)
20*67e74705SXin Livoid f(id a) {
21*67e74705SXin Li  [a partiallyUnavailableMethod];  // no warning, `a` could be an Interface1.
22*67e74705SXin Li}
23*67e74705SXin Li#endif
24