blob: 8b824081a1e398f114b57ab5420ce6d78547a0ff [file] [log] [blame]
Andy Gibbsb42f2002013-04-17 08:06:46 +00001// RUN: rm -rf %t
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
Stephen Hines651f13c2014-04-23 16:59:28 -07006// RUN: %clang_cc1 -fmodules -x objective-c -fmodules-cache-path=%t -I %S/Inputs %s -verify
Andy Gibbsb42f2002013-04-17 08:06:46 +00007// FIXME: When we have a syntax for modules in C, use that.
Douglas Gregor6aa52ec2011-08-26 23:56:07 +00008
Douglas Gregor1b257af2012-12-11 22:11:52 +00009@import diamond_bottom;
Douglas Gregor6aa52ec2011-08-26 23:56:07 +000010
Douglas Gregorfac4ece2011-08-19 02:29:29 +000011void test_diamond(int i, float f, double d, char c) {
12 top(&i);
13 left(&f);
14 right(&d);
15 bottom(&c);
Andy Gibbsb42f2002013-04-17 08:06:46 +000016 bottom(&d);
17 // expected-warning@-1{{incompatible pointer types passing 'double *' to parameter of type 'char *'}}
18 // expected-note@Inputs/diamond_bottom.h:4{{passing argument to parameter 'x' here}}
Douglas Gregor211f6e82011-08-20 04:39:52 +000019
20 // Names in multiple places in the diamond.
21 top_left(&c);
Douglas Gregor0c02ada2011-08-20 05:09:43 +000022
23 left_and_right(&i);
24 struct left_and_right lr;
25 lr.left = 17;
Douglas Gregorfac4ece2011-08-19 02:29:29 +000026}
27