diamond.c revision 1b257afbae854c6817f26b7d61c4fed8ff7aebad
16aa52ec6b969faabf3764baf79d89810b8249a7eDouglas Gregor 26aa52ec6b969faabf3764baf79d89810b8249a7eDouglas Gregor 36aa52ec6b969faabf3764baf79d89810b8249a7eDouglas Gregor 4fac4ece118d43e43e625c6d2b9a98905b1372d51Douglas Gregor// in diamond-bottom.h: expected-note{{passing argument to parameter 'x' here}} 56aa52ec6b969faabf3764baf79d89810b8249a7eDouglas Gregor 61b257afbae854c6817f26b7d61c4fed8ff7aebadDouglas Gregor@import diamond_bottom; 76aa52ec6b969faabf3764baf79d89810b8249a7eDouglas Gregor 8fac4ece118d43e43e625c6d2b9a98905b1372d51Douglas Gregorvoid test_diamond(int i, float f, double d, char c) { 9fac4ece118d43e43e625c6d2b9a98905b1372d51Douglas Gregor top(&i); 10fac4ece118d43e43e625c6d2b9a98905b1372d51Douglas Gregor left(&f); 11fac4ece118d43e43e625c6d2b9a98905b1372d51Douglas Gregor right(&d); 12fac4ece118d43e43e625c6d2b9a98905b1372d51Douglas Gregor bottom(&c); 13fac4ece118d43e43e625c6d2b9a98905b1372d51Douglas Gregor bottom(&d); // expected-warning{{incompatible pointer types passing 'double *' to parameter of type 'char *'}} 14211f6e894895f552e0a98421b2f6e931ca4a8c11Douglas Gregor 15211f6e894895f552e0a98421b2f6e931ca4a8c11Douglas Gregor // Names in multiple places in the diamond. 16211f6e894895f552e0a98421b2f6e931ca4a8c11Douglas Gregor top_left(&c); 170c02adaa4da1d87495ca6a6d394f78740fa475c4Douglas Gregor 180c02adaa4da1d87495ca6a6d394f78740fa475c4Douglas Gregor left_and_right(&i); 190c02adaa4da1d87495ca6a6d394f78740fa475c4Douglas Gregor struct left_and_right lr; 200c02adaa4da1d87495ca6a6d394f78740fa475c4Douglas Gregor lr.left = 17; 21fac4ece118d43e43e625c6d2b9a98905b1372d51Douglas Gregor} 22fac4ece118d43e43e625c6d2b9a98905b1372d51Douglas Gregor 23db1cde7dc7bb3aaf48118bd9605192ab94a93635Douglas Gregor// RUN: rm -rf %t 24c13a34b690d2dc2a03c2fea75a0a1438636c19ceDouglas Gregor// RUN: %clang_cc1 -fmodules -x objective-c -emit-module -fmodule-cache-path %t -fmodule-name=diamond_top %S/Inputs/module.map 25c13a34b690d2dc2a03c2fea75a0a1438636c19ceDouglas Gregor// RUN: %clang_cc1 -fmodules -x objective-c -emit-module -fmodule-cache-path %t -fmodule-name=diamond_left %S/Inputs/module.map 26c13a34b690d2dc2a03c2fea75a0a1438636c19ceDouglas Gregor// RUN: %clang_cc1 -fmodules -x objective-c -emit-module -fmodule-cache-path %t -fmodule-name=diamond_right %S/Inputs/module.map 27c13a34b690d2dc2a03c2fea75a0a1438636c19ceDouglas Gregor// RUN: %clang_cc1 -fmodules -x objective-c -emit-module -fmodule-cache-path %t -fmodule-name=diamond_bottom %S/Inputs/module.map 28c13a34b690d2dc2a03c2fea75a0a1438636c19ceDouglas Gregor// RUN: %clang_cc1 -fmodules -x objective-c -fmodule-cache-path %t %s -verify 29c13a34b690d2dc2a03c2fea75a0a1438636c19ceDouglas Gregor// FIXME: When we have a syntax for modules in C, use that. 30