1b42f200777a66b98989160bf3987ce431540a584Andy Gibbs// RUN: rm -rf %t
2b42f200777a66b98989160bf3987ce431540a584Andy Gibbs// RUN: %clang_cc1 -fmodules -x objective-c -emit-module -fmodules-cache-path=%t -fmodule-name=diamond_top %S/Inputs/module.map
3b42f200777a66b98989160bf3987ce431540a584Andy Gibbs// RUN: %clang_cc1 -fmodules -x objective-c -emit-module -fmodules-cache-path=%t -fmodule-name=diamond_left %S/Inputs/module.map
4b42f200777a66b98989160bf3987ce431540a584Andy Gibbs// RUN: %clang_cc1 -fmodules -x objective-c -emit-module -fmodules-cache-path=%t -fmodule-name=diamond_right %S/Inputs/module.map
5b42f200777a66b98989160bf3987ce431540a584Andy Gibbs// RUN: %clang_cc1 -fmodules -x objective-c -emit-module -fmodules-cache-path=%t -fmodule-name=diamond_bottom %S/Inputs/module.map
6651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines// RUN: %clang_cc1 -fmodules -x objective-c -fmodules-cache-path=%t -I %S/Inputs %s -verify
7b42f200777a66b98989160bf3987ce431540a584Andy Gibbs// FIXME: When we have a syntax for modules in C, use that.
86aa52ec6b969faabf3764baf79d89810b8249a7eDouglas Gregor
91b257afbae854c6817f26b7d61c4fed8ff7aebadDouglas Gregor@import diamond_bottom;
106aa52ec6b969faabf3764baf79d89810b8249a7eDouglas Gregor
11fac4ece118d43e43e625c6d2b9a98905b1372d51Douglas Gregorvoid test_diamond(int i, float f, double d, char c) {
12fac4ece118d43e43e625c6d2b9a98905b1372d51Douglas Gregor  top(&i);
13fac4ece118d43e43e625c6d2b9a98905b1372d51Douglas Gregor  left(&f);
14fac4ece118d43e43e625c6d2b9a98905b1372d51Douglas Gregor  right(&d);
15fac4ece118d43e43e625c6d2b9a98905b1372d51Douglas Gregor  bottom(&c);
16b42f200777a66b98989160bf3987ce431540a584Andy Gibbs  bottom(&d);
17b42f200777a66b98989160bf3987ce431540a584Andy Gibbs  // expected-warning@-1{{incompatible pointer types passing 'double *' to parameter of type 'char *'}}
18b42f200777a66b98989160bf3987ce431540a584Andy Gibbs  // expected-note@Inputs/diamond_bottom.h:4{{passing argument to parameter 'x' here}}
19211f6e894895f552e0a98421b2f6e931ca4a8c11Douglas Gregor
20211f6e894895f552e0a98421b2f6e931ca4a8c11Douglas Gregor  // Names in multiple places in the diamond.
21211f6e894895f552e0a98421b2f6e931ca4a8c11Douglas Gregor  top_left(&c);
220c02adaa4da1d87495ca6a6d394f78740fa475c4Douglas Gregor
230c02adaa4da1d87495ca6a6d394f78740fa475c4Douglas Gregor  left_and_right(&i);
240c02adaa4da1d87495ca6a6d394f78740fa475c4Douglas Gregor  struct left_and_right lr;
250c02adaa4da1d87495ca6a6d394f78740fa475c4Douglas Gregor  lr.left = 17;
26fac4ece118d43e43e625c6d2b9a98905b1372d51Douglas Gregor}
27fac4ece118d43e43e625c6d2b9a98905b1372d51Douglas Gregor
28