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