xref: /aosp_15_r20/external/clang/test/SemaObjCXX/objc2-merge-gc-attribue-decl.mm (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 __strong id CFRunLoopGetMain2();
14*67e74705SXin Liextern id CFRunLoopGetMain2();
15*67e74705SXin Li
16*67e74705SXin Liextern INTF* CFRunLoopGetMain3();
17*67e74705SXin Liextern __strong INTF* CFRunLoopGetMain3();
18*67e74705SXin Li
19*67e74705SXin Liextern __strong INTF* CFRunLoopGetMain4();
20*67e74705SXin Liextern INTF* CFRunLoopGetMain4();
21*67e74705SXin Li
22*67e74705SXin Litypedef id ID;
23*67e74705SXin Liextern ID CFRunLoopGetMain5();
24*67e74705SXin Liextern __strong id CFRunLoopGetMain5();
25*67e74705SXin Li
26*67e74705SXin Liextern __strong id CFRunLoopGetMain6();
27*67e74705SXin Liextern ID CFRunLoopGetMain6();
28*67e74705SXin Li
29*67e74705SXin Liextern ID CFRunLoopGetMain7();
30*67e74705SXin Liextern __strong ID CFRunLoopGetMain7();
31*67e74705SXin Li
32*67e74705SXin Liextern __strong ID CFRunLoopGetMain8();
33*67e74705SXin Liextern ID CFRunLoopGetMain8();
34*67e74705SXin Li
35*67e74705SXin Liextern __weak id WLoopGetMain(); // expected-note {{previous declaration is here}}
36*67e74705SXin Liextern id WLoopGetMain();	// expected-error {{functions that differ only in their return type cannot be overloaded}}
37*67e74705SXin Li
38*67e74705SXin Liextern id p3;	// expected-note {{previous declaration is here}}
39*67e74705SXin Liextern __weak id p3;	// expected-error {{redeclaration of 'p3' with a different type}}
40*67e74705SXin Li
41*67e74705SXin Liextern void *p4; // expected-note {{previous declaration is here}}
42*67e74705SXin Liextern void * __strong p4; // expected-error {{redeclaration of 'p4' with a different type}}
43*67e74705SXin Li
44*67e74705SXin Liextern id p5;
45*67e74705SXin Liextern __strong id p5;
46*67e74705SXin Li
47*67e74705SXin Liextern char* __strong p6; // expected-note {{previous declaration is here}}
48*67e74705SXin Liextern char* p6; // expected-error {{redeclaration of 'p6' with a different type}}
49*67e74705SXin Li
50*67e74705SXin Liextern __strong char* p7; // expected-note {{previous declaration is here}}
51*67e74705SXin Liextern char* p7; // expected-error {{redeclaration of 'p7' with a different type}}
52