xref: /aosp_15_r20/external/clang/test/SemaObjC/objc2-merge-gc-attribue-decl.m (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-gc -fsyntax-only -verify %s
2*67e74705SXin Li@interface INTF @end
3*67e74705SXin Li
4*67e74705SXin Liextern INTF* p2;
5*67e74705SXin Liextern __strong INTF* p2;
6*67e74705SXin Li
7*67e74705SXin Liextern __strong id p1;
8*67e74705SXin Liextern id p1;
9*67e74705SXin Li
10*67e74705SXin Liextern id CFRunLoopGetMain();
11*67e74705SXin Liextern __strong id CFRunLoopGetMain();
12*67e74705SXin Li
13*67e74705SXin Liextern __weak id WLoopGetMain(); // expected-note {{previous declaration is here}}
14*67e74705SXin Liextern id WLoopGetMain();	// expected-error {{conflicting types for 'WLoopGetMain'}}
15*67e74705SXin Li
16*67e74705SXin Liextern id p3;	// expected-note {{previous declaration is here}}
17*67e74705SXin Liextern __weak id p3;	// expected-error {{redeclaration of 'p3' with a different type}}
18*67e74705SXin Li
19*67e74705SXin Liextern void *p4; // expected-note {{previous declaration is here}}
20*67e74705SXin Liextern void * __strong p4; // expected-error {{redeclaration of 'p4' with a different type}}
21*67e74705SXin Li
22*67e74705SXin Liextern id p5;
23*67e74705SXin Liextern __strong id p5;
24*67e74705SXin Li
25*67e74705SXin Liextern char* __strong p6; // expected-note {{previous declaration is here}}
26*67e74705SXin Liextern char* p6; // expected-error {{redeclaration of 'p6' with a different type}}
27*67e74705SXin Li
28*67e74705SXin Liextern __strong char* p7; // expected-note {{previous declaration is here}}
29*67e74705SXin Liextern char* p7; // expected-error {{redeclaration of 'p7' with a different type}}
30