11b257afbae854c6817f26b7d61c4fed8ff7aebadDouglas Gregor@import redecl_merge_top;
2a1be278c4f3a234ff61f04018d26c6beecde1654Douglas Gregor
3a1be278c4f3a234ff61f04018d26c6beecde1654Douglas Gregor@class A;
4a1be278c4f3a234ff61f04018d26c6beecde1654Douglas Gregor
5a1be278c4f3a234ff61f04018d26c6beecde1654Douglas Gregor@class A;
6a1be278c4f3a234ff61f04018d26c6beecde1654Douglas Gregor
7ecb19382e1041f4e90f44c541173b85e4f328b84Douglas Gregor@interface B
8adafc2edc0dc4fa25ea6f0a136f599a6ac279081Douglas Gregor+ (B*) create_a_B;
9ecb19382e1041f4e90f44c541173b85e4f328b84Douglas Gregor@end
10ecb19382e1041f4e90f44c541173b85e4f328b84Douglas Gregor
11a1be278c4f3a234ff61f04018d26c6beecde1654Douglas Gregor@class A;
12ecb19382e1041f4e90f44c541173b85e4f328b84Douglas Gregor
1327c6da284f90e32cda0ec8f52a2b6ba5a2613252Douglas Gregor@protocol P1;
1427c6da284f90e32cda0ec8f52a2b6ba5a2613252Douglas Gregor@protocol P2
1527c6da284f90e32cda0ec8f52a2b6ba5a2613252Douglas Gregor- (void)protoMethod2;
1627c6da284f90e32cda0ec8f52a2b6ba5a2613252Douglas Gregor@end
1727c6da284f90e32cda0ec8f52a2b6ba5a2613252Douglas Gregor
181ca4a5c41b8707b5fafcd1af1c9824b1bb19a399Douglas Gregorstruct S1;
191ca4a5c41b8707b5fafcd1af1c9824b1bb19a399Douglas Gregorstruct S2 {
201ca4a5c41b8707b5fafcd1af1c9824b1bb19a399Douglas Gregor  int field;
211ca4a5c41b8707b5fafcd1af1c9824b1bb19a399Douglas Gregor};
221ca4a5c41b8707b5fafcd1af1c9824b1bb19a399Douglas Gregor
231ca4a5c41b8707b5fafcd1af1c9824b1bb19a399Douglas Gregorstruct S1 *produce_S1(void);
241ca4a5c41b8707b5fafcd1af1c9824b1bb19a399Douglas Gregorvoid consume_S2(struct S2*);
251ca4a5c41b8707b5fafcd1af1c9824b1bb19a399Douglas Gregor
260f75323264b93a318ac9007eb5ec5b233c444068Douglas Gregor// Test declarations in different modules with no common initial
270f75323264b93a318ac9007eb5ec5b233c444068Douglas Gregor// declaration.
280f75323264b93a318ac9007eb5ec5b233c444068Douglas Gregor@class C;
290f75323264b93a318ac9007eb5ec5b233c444068Douglas Gregorvoid accept_a_C(C*);
300f75323264b93a318ac9007eb5ec5b233c444068Douglas Gregor
310f75323264b93a318ac9007eb5ec5b233c444068Douglas Gregor@class C2;
320f75323264b93a318ac9007eb5ec5b233c444068Douglas Gregorvoid accept_a_C2(C2*);
330f75323264b93a318ac9007eb5ec5b233c444068Douglas Gregor
340f75323264b93a318ac9007eb5ec5b233c444068Douglas Gregor@class C3;
350f75323264b93a318ac9007eb5ec5b233c444068Douglas Gregorvoid accept_a_C3(C3*);
360f75323264b93a318ac9007eb5ec5b233c444068Douglas Gregor@class C3;
370f75323264b93a318ac9007eb5ec5b233c444068Douglas Gregor
38c3cfd2ab3338d47861ece597212f21b972ebe727Douglas Gregor@class C4;
39c3cfd2ab3338d47861ece597212f21b972ebe727Douglas Gregor
402ccd89cff3f1c18b48f649240302446a7dae28b9Douglas Gregor@class Explicit;
412ccd89cff3f1c18b48f649240302446a7dae28b9Douglas Gregor
422ccd89cff3f1c18b48f649240302446a7dae28b9Douglas Gregorint *explicit_func(void);
432ccd89cff3f1c18b48f649240302446a7dae28b9Douglas Gregor
442ccd89cff3f1c18b48f649240302446a7dae28b9Douglas Gregorstruct explicit_struct;
452ccd89cff3f1c18b48f649240302446a7dae28b9Douglas Gregor
46dba9361891ab147b6ea658c1834bc1d660f5226bDouglas Gregor@protocol P3, P4;
47dba9361891ab147b6ea658c1834bc1d660f5226bDouglas Gregor
48dba9361891ab147b6ea658c1834bc1d660f5226bDouglas Gregor@protocol P3;
49dba9361891ab147b6ea658c1834bc1d660f5226bDouglas Gregor
501ca4a5c41b8707b5fafcd1af1c9824b1bb19a399Douglas Gregorstruct S3;
511ca4a5c41b8707b5fafcd1af1c9824b1bb19a399Douglas Gregorstruct S3;
521ca4a5c41b8707b5fafcd1af1c9824b1bb19a399Douglas Gregorstruct S4 {
531ca4a5c41b8707b5fafcd1af1c9824b1bb19a399Douglas Gregor  int field;
541ca4a5c41b8707b5fafcd1af1c9824b1bb19a399Douglas Gregor};
551ca4a5c41b8707b5fafcd1af1c9824b1bb19a399Douglas Gregor
561ca4a5c41b8707b5fafcd1af1c9824b1bb19a399Douglas Gregorstruct S3 *produce_S3(void);
571ca4a5c41b8707b5fafcd1af1c9824b1bb19a399Douglas Gregorvoid consume_S4(struct S4*);
581ca4a5c41b8707b5fafcd1af1c9824b1bb19a399Douglas Gregor
597a537404f039d4b7d063bbdc3c8c924be977dff2Douglas Gregortypedef int T1;
607a537404f039d4b7d063bbdc3c8c924be977dff2Douglas Gregortypedef float T2;
617a537404f039d4b7d063bbdc3c8c924be977dff2Douglas Gregor
627076281fcaab2a01e6226b05c822dd3142167636Douglas Gregorint func0(int);
635456b0fe40714a78cd0ba7c1a5b7dc34eda385afDouglas Gregorint func1(int x) { return x; }
647076281fcaab2a01e6226b05c822dd3142167636Douglas Gregorint func2(int);
657076281fcaab2a01e6226b05c822dd3142167636Douglas Gregor
664791fa2c3c16c51c8435706682ec0fec8647335aDouglas Gregor
674791fa2c3c16c51c8435706682ec0fec8647335aDouglas Gregor
684791fa2c3c16c51c8435706682ec0fec8647335aDouglas Gregor
694791fa2c3c16c51c8435706682ec0fec8647335aDouglas Gregor
704791fa2c3c16c51c8435706682ec0fec8647335aDouglas Gregor
714791fa2c3c16c51c8435706682ec0fec8647335aDouglas Gregor
724791fa2c3c16c51c8435706682ec0fec8647335aDouglas Gregor
734791fa2c3c16c51c8435706682ec0fec8647335aDouglas Gregor
744791fa2c3c16c51c8435706682ec0fec8647335aDouglas Gregor
754791fa2c3c16c51c8435706682ec0fec8647335aDouglas Gregor// Spacing matters!
764791fa2c3c16c51c8435706682ec0fec8647335aDouglas Gregorextern int var1;
774791fa2c3c16c51c8435706682ec0fec8647335aDouglas Gregorextern float var2;
784791fa2c3c16c51c8435706682ec0fec8647335aDouglas Gregor
794791fa2c3c16c51c8435706682ec0fec8647335aDouglas Gregorextern double var3;
804791fa2c3c16c51c8435706682ec0fec8647335aDouglas Gregor
8191534a357695fbdf3c136fb04218e37706da73a9Douglas Gregor// Make sure this doesn't introduce an ambiguity-creating 'id' at the
8291534a357695fbdf3c136fb04218e37706da73a9Douglas Gregor// top level.
8391534a357695fbdf3c136fb04218e37706da73a9Douglas Gregortypedef void funcptr_with_id(int id);
8491534a357695fbdf3c136fb04218e37706da73a9Douglas Gregor
85f4e955b694be22926f5ceb41e55d319ce9ff4aabDouglas Gregor// A class that is declared in the 'bottom' module, then loaded from
86f4e955b694be22926f5ceb41e55d319ce9ff4aabDouglas Gregor// one of the modules it depends on.
87f4e955b694be22926f5ceb41e55d319ce9ff4aabDouglas Gregor@interface DeclaredThenLoaded
88f4e955b694be22926f5ceb41e55d319ce9ff4aabDouglas Gregor- declaredThenLoadedMethod;
89f4e955b694be22926f5ceb41e55d319ce9ff4aabDouglas Gregor@end
90f4e955b694be22926f5ceb41e55d319ce9ff4aabDouglas Gregor
91f4e955b694be22926f5ceb41e55d319ce9ff4aabDouglas Gregor@class DeclaredThenLoaded;
92f4e955b694be22926f5ceb41e55d319ce9ff4aabDouglas Gregor
93aa945900d5438984bdcaac85c4f54868292231f4Douglas Gregorvoid eventually_noreturn2(void);
94