Douglas Gregor | 4ba7c2a | 2011-11-16 15:22:03 +0000 | [diff] [blame] | 1 | // RUN: rm -rf %t |
Douglas Gregor | 0bf886d | 2012-01-03 18:24:14 +0000 | [diff] [blame] | 2 | // 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 Gregor | 404cdde | 2012-01-27 01:47:08 +0000 | [diff] [blame^] | 6 | // RUN: %clang_cc1 -fmodules -fmodule-cache-path %t -x objective-c -fmodule-name=category_other -emit-module %S/Inputs/module.map |
Douglas Gregor | 0bf886d | 2012-01-03 18:24:14 +0000 | [diff] [blame] | 7 | // RUN: %clang_cc1 -fmodules -fmodule-cache-path %t %s -verify |
Argyrios Kyrtzidis | 7d847c9 | 2011-09-01 00:58:55 +0000 | [diff] [blame] | 8 | |
Douglas Gregor | 22d0974 | 2012-01-03 18:04:46 +0000 | [diff] [blame] | 9 | @import category_bottom; |
Argyrios Kyrtzidis | 7d847c9 | 2011-09-01 00:58:55 +0000 | [diff] [blame] | 10 | |
Douglas Gregor | 6ac0b71 | 2011-09-01 19:02:18 +0000 | [diff] [blame] | 11 | |
Douglas Gregor | 404cdde | 2012-01-27 01:47:08 +0000 | [diff] [blame^] | 12 | |
| 13 | |
Douglas Gregor | 4ba7c2a | 2011-11-16 15:22:03 +0000 | [diff] [blame] | 14 | // in category_left.h: expected-note {{previous definition}} |
Argyrios Kyrtzidis | 7d847c9 | 2011-09-01 00:58:55 +0000 | [diff] [blame] | 15 | |
| 16 | @interface Foo(Source) |
Douglas Gregor | 4ba7c2a | 2011-11-16 15:22:03 +0000 | [diff] [blame] | 17 | -(void)source; |
Argyrios Kyrtzidis | 7d847c9 | 2011-09-01 00:58:55 +0000 | [diff] [blame] | 18 | @end |
| 19 | |
| 20 | void test(Foo *foo, LeftFoo *leftFoo) { |
| 21 | [foo source]; |
| 22 | [foo bottom]; |
| 23 | [foo left]; |
| 24 | [foo right1]; |
| 25 | [foo right2]; |
| 26 | [foo top]; |
Douglas Gregor | 404cdde | 2012-01-27 01:47:08 +0000 | [diff] [blame^] | 27 | [foo top2]; |
| 28 | [foo top3]; |
Argyrios Kyrtzidis | 7d847c9 | 2011-09-01 00:58:55 +0000 | [diff] [blame] | 29 | |
| 30 | [leftFoo left]; |
| 31 | [leftFoo bottom]; |
| 32 | } |
Douglas Gregor | 404cdde | 2012-01-27 01:47:08 +0000 | [diff] [blame^] | 33 | |
| 34 | // Load another module that also adds categories to Foo, verify that |
| 35 | // we see those categories. |
| 36 | @import category_other; |
| 37 | |
| 38 | void test_other(Foo *foo) { |
| 39 | [foo other]; |
| 40 | } |