blob: a8f8fb3d04924cee44dfab6f4c4c22fa27475aaf [file] [log] [blame]
Douglas Gregor4ba7c2a2011-11-16 15:22:03 +00001// RUN: rm -rf %t
Douglas Gregor0bf886d2012-01-03 18:24:14 +00002// RUN: %clang_cc1 -fmodules -fmodule-cache-path %t -x objective-c -fmodule-name=category_top -emit-module %S/Inputs/module.map
3// RUN: %clang_cc1 -fmodules -fmodule-cache-path %t -x objective-c -fmodule-name=category_left -emit-module %S/Inputs/module.map
4// RUN: %clang_cc1 -fmodules -fmodule-cache-path %t -x objective-c -fmodule-name=category_right -emit-module %S/Inputs/module.map
5// RUN: %clang_cc1 -fmodules -fmodule-cache-path %t -x objective-c -fmodule-name=category_bottom -emit-module %S/Inputs/module.map
Douglas Gregor404cdde2012-01-27 01:47:08 +00006// RUN: %clang_cc1 -fmodules -fmodule-cache-path %t -x objective-c -fmodule-name=category_other -emit-module %S/Inputs/module.map
Douglas Gregor0bf886d2012-01-03 18:24:14 +00007// RUN: %clang_cc1 -fmodules -fmodule-cache-path %t %s -verify
Argyrios Kyrtzidis7d847c92011-09-01 00:58:55 +00008
Douglas Gregor22d09742012-01-03 18:04:46 +00009@import category_bottom;
Argyrios Kyrtzidis7d847c92011-09-01 00:58:55 +000010
Douglas Gregor6ac0b712011-09-01 19:02:18 +000011
Douglas Gregor404cdde2012-01-27 01:47:08 +000012
13
Douglas Gregor4ba7c2a2011-11-16 15:22:03 +000014// in category_left.h: expected-note {{previous definition}}
Argyrios Kyrtzidis7d847c92011-09-01 00:58:55 +000015
16@interface Foo(Source)
Douglas Gregor4ba7c2a2011-11-16 15:22:03 +000017-(void)source;
Argyrios Kyrtzidis7d847c92011-09-01 00:58:55 +000018@end
19
20void test(Foo *foo, LeftFoo *leftFoo) {
21 [foo source];
22 [foo bottom];
23 [foo left];
24 [foo right1];
25 [foo right2];
26 [foo top];
Douglas Gregor404cdde2012-01-27 01:47:08 +000027 [foo top2];
28 [foo top3];
Argyrios Kyrtzidis7d847c92011-09-01 00:58:55 +000029
30 [leftFoo left];
31 [leftFoo bottom];
32}
Douglas Gregor404cdde2012-01-27 01:47:08 +000033
34// Load another module that also adds categories to Foo, verify that
35// we see those categories.
36@import category_other;
37
38void test_other(Foo *foo) {
39 [foo other];
40}