Douglas Gregor | 6236a29 | 2011-12-02 21:56:05 +0000 | [diff] [blame] | 1 | // RUN: rm -rf %t |
Douglas Gregor | 953a61f | 2013-02-07 19:01:24 +0000 | [diff] [blame] | 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 -emit-pch -fmodules-cache-path=%t -o %t.pch %S/Inputs/diamond.h |
| 7 | // RUN: %clang_cc1 -fmodules -x objective-c -fmodules-cache-path=%t -include-pch %t.pch %s -verify |
Douglas Gregor | c13a34b | 2012-01-03 19:32:59 +0000 | [diff] [blame] | 8 | // FIXME: When we have a syntax for modules in C, use that. |
Andy Gibbs | b42f200 | 2013-04-17 08:06:46 +0000 | [diff] [blame] | 9 | |
| 10 | void test_diamond(int i, float f, double d, char c) { |
| 11 | top(&i); |
| 12 | left(&f); |
| 13 | right(&d); |
| 14 | bottom(&c); |
| 15 | bottom(&d); |
| 16 | // expected-warning@-1{{incompatible pointer types passing 'double *' to parameter of type 'char *'}} |
| 17 | // expected-note@Inputs/diamond_bottom.h:4{{passing argument to parameter 'x' here}} |
| 18 | |
| 19 | // Names in multiple places in the diamond. |
| 20 | top_left(&c); |
| 21 | |
| 22 | left_and_right(&i); |
| 23 | struct left_and_right lr; |
| 24 | lr.left = 17; |
| 25 | } |