blob: 1d8902101ee4b615bf39a9db7f519cae7c23032b [file] [log] [blame]
Douglas Gregor6aa52ec2011-08-26 23:56:07 +00001
2
3
Douglas Gregorfac4ece2011-08-19 02:29:29 +00004// in diamond-bottom.h: expected-note{{passing argument to parameter 'x' here}}
Douglas Gregor6aa52ec2011-08-26 23:56:07 +00005
Douglas Gregor1b257af2012-12-11 22:11:52 +00006@import diamond_bottom;
Douglas Gregor6aa52ec2011-08-26 23:56:07 +00007
Douglas Gregorfac4ece2011-08-19 02:29:29 +00008void 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 Gregor211f6e82011-08-20 04:39:52 +000014
15 // Names in multiple places in the diamond.
16 top_left(&c);
Douglas Gregor0c02ada2011-08-20 05:09:43 +000017
18 left_and_right(&i);
19 struct left_and_right lr;
20 lr.left = 17;
Douglas Gregorfac4ece2011-08-19 02:29:29 +000021}
22
Douglas Gregordb1cde72011-11-16 00:09:06 +000023// RUN: rm -rf %t
Douglas Gregorc13a34b2012-01-03 19:32:59 +000024// 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.