Andy Gibbs | b42f200 | 2013-04-17 08:06:46 +0000 | [diff] [blame] | 1 | // RUN: rm -rf %t |
| 2 | // RUN: %clang_cc1 -fmodules -x objective-c -emit-module -fmodules-cache-path=%t -fmodule-name=diamond_top %S/Inputs/module.map |
| 3 | // RUN: %clang_cc1 -fmodules -x objective-c -emit-module -fmodules-cache-path=%t -fmodule-name=diamond_left %S/Inputs/module.map |
| 4 | // RUN: %clang_cc1 -fmodules -x objective-c -emit-module -fmodules-cache-path=%t -fmodule-name=diamond_right %S/Inputs/module.map |
| 5 | // RUN: %clang_cc1 -fmodules -x objective-c -emit-module -fmodules-cache-path=%t -fmodule-name=diamond_bottom %S/Inputs/module.map |
| 6 | // RUN: %clang_cc1 -fmodules -x objective-c -fmodules-cache-path=%t %s -verify |
| 7 | // FIXME: When we have a syntax for modules in C, use that. |
Douglas Gregor | 6aa52ec | 2011-08-26 23:56:07 +0000 | [diff] [blame] | 8 | |
Douglas Gregor | 1b257af | 2012-12-11 22:11:52 +0000 | [diff] [blame] | 9 | @import diamond_bottom; |
Douglas Gregor | 6aa52ec | 2011-08-26 23:56:07 +0000 | [diff] [blame] | 10 | |
Douglas Gregor | fac4ece | 2011-08-19 02:29:29 +0000 | [diff] [blame] | 11 | void test_diamond(int i, float f, double d, char c) { |
| 12 | top(&i); |
| 13 | left(&f); |
| 14 | right(&d); |
| 15 | bottom(&c); |
Andy Gibbs | b42f200 | 2013-04-17 08:06:46 +0000 | [diff] [blame] | 16 | bottom(&d); |
| 17 | // expected-warning@-1{{incompatible pointer types passing 'double *' to parameter of type 'char *'}} |
| 18 | // expected-note@Inputs/diamond_bottom.h:4{{passing argument to parameter 'x' here}} |
Douglas Gregor | 211f6e8 | 2011-08-20 04:39:52 +0000 | [diff] [blame] | 19 | |
| 20 | // Names in multiple places in the diamond. |
| 21 | top_left(&c); |
Douglas Gregor | 0c02ada | 2011-08-20 05:09:43 +0000 | [diff] [blame] | 22 | |
| 23 | left_and_right(&i); |
| 24 | struct left_and_right lr; |
| 25 | lr.left = 17; |
Douglas Gregor | fac4ece | 2011-08-19 02:29:29 +0000 | [diff] [blame] | 26 | } |
| 27 | |