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