Andy Gibbs | b42f200 | 2013-04-17 08:06:46 +0000 | [diff] [blame] | 1 | // RUN: rm -rf %t |
| 2 | // RUN: %clang_cc1 -fmodules -x objective-c -fmodules-cache-path=%t -emit-module -fmodule-name=linkage_merge_left %S/Inputs/module.map |
| 3 | // RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -w %s -verify |
Douglas Gregor | 7dc80e1 | 2013-01-09 00:47:56 +0000 | [diff] [blame] | 4 | |
| 5 | // Test redeclarations of functions where the original declaration is |
| 6 | // still hidden. |
| 7 | |
| 8 | @import linkage_merge_left; // excludes "sub" |
| 9 | |
Andy Gibbs | b42f200 | 2013-04-17 08:06:46 +0000 | [diff] [blame] | 10 | extern int f0(float); |
| 11 | // expected-error@-1{{conflicting types for 'f0'}} |
| 12 | // expected-note@Inputs/linkage-merge-sub.h:1{{previous declaration}} |
| 13 | |
Douglas Gregor | 7dc80e1 | 2013-01-09 00:47:56 +0000 | [diff] [blame] | 14 | static int f1(float); // okay: considered distinct |
| 15 | static int f2(float); // okay: considered distinct |
| 16 | extern int f3(float); // okay: considered distinct |
| 17 | |
Andy Gibbs | b42f200 | 2013-04-17 08:06:46 +0000 | [diff] [blame] | 18 | extern float v0; |
| 19 | // expected-error@-1{{redefinition of 'v0' with a different type: 'float' vs 'int'}} |
| 20 | // expected-note@Inputs/linkage-merge-sub.h:6{{previous definition is here}} |
| 21 | |
Douglas Gregor | 7dc80e1 | 2013-01-09 00:47:56 +0000 | [diff] [blame] | 22 | static float v1; |
| 23 | static float v2; |
| 24 | extern float v3; |
| 25 | |
| 26 | typedef float T0; |