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 -emit-pch -fmodules-cache-path=%t -I %S/Inputs -o %t.pch %S/Inputs/diamond.h
76bcf27bb9a4b5c3f79cb44c0e4654a6d7619ad89Stephen Hines// RUN: %clang_cc1 -fmodules -x objective-c -fmodules-cache-path=%t -include-pch %t.pch %s -I %S/Inputs -verify
8b42f200777a66b98989160bf3987ce431540a584Andy Gibbs// FIXME: When we have a syntax for modules in C, use that.
96236a29f5082d4736c4593ca1a04595037db1685Douglas Gregor
106236a29f5082d4736c4593ca1a04595037db1685Douglas Gregorvoid test_diamond(int i, float f, double d, char c) {
116236a29f5082d4736c4593ca1a04595037db1685Douglas Gregor  top(&i);
126236a29f5082d4736c4593ca1a04595037db1685Douglas Gregor  left(&f);
136236a29f5082d4736c4593ca1a04595037db1685Douglas Gregor  right(&d);
146236a29f5082d4736c4593ca1a04595037db1685Douglas Gregor  bottom(&c);
15b42f200777a66b98989160bf3987ce431540a584Andy Gibbs  bottom(&d);
16b42f200777a66b98989160bf3987ce431540a584Andy Gibbs  // expected-warning@-1{{incompatible pointer types passing 'double *' to parameter of type 'char *'}}
17b42f200777a66b98989160bf3987ce431540a584Andy Gibbs  // expected-note@Inputs/diamond_bottom.h:4{{passing argument to parameter 'x' here}}
186236a29f5082d4736c4593ca1a04595037db1685Douglas Gregor
196236a29f5082d4736c4593ca1a04595037db1685Douglas Gregor  // Names in multiple places in the diamond.
206236a29f5082d4736c4593ca1a04595037db1685Douglas Gregor  top_left(&c);
216236a29f5082d4736c4593ca1a04595037db1685Douglas Gregor
226236a29f5082d4736c4593ca1a04595037db1685Douglas Gregor  left_and_right(&i);
236236a29f5082d4736c4593ca1a04595037db1685Douglas Gregor  struct left_and_right lr;
246236a29f5082d4736c4593ca1a04595037db1685Douglas Gregor  lr.left = 17;
256236a29f5082d4736c4593ca1a04595037db1685Douglas Gregor}
26