xref: /minix3/external/bsd/llvm/dist/clang/test/Modules/linkage-merge.m (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1f4a2713aSLionel Sambuc// RUN: rm -rf %t
2f4a2713aSLionel Sambuc// RUN: %clang_cc1 -fmodules -x objective-c -fmodules-cache-path=%t -emit-module -fmodule-name=linkage_merge_left %S/Inputs/module.map
3*0a6a1f1dSLionel Sambuc// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -I %S/Inputs -w %s -verify
4f4a2713aSLionel Sambuc
5f4a2713aSLionel Sambuc// Test redeclarations of functions where the original declaration is
6f4a2713aSLionel Sambuc// still hidden.
7f4a2713aSLionel Sambuc
8f4a2713aSLionel Sambuc@import linkage_merge_left; // excludes "sub"
9f4a2713aSLionel Sambuc
10f4a2713aSLionel Sambucextern int f0(float);
11f4a2713aSLionel Sambuc// expected-error@-1{{conflicting types for 'f0'}}
12f4a2713aSLionel Sambuc// expected-note@Inputs/linkage-merge-sub.h:1{{previous declaration}}
13f4a2713aSLionel Sambuc
14f4a2713aSLionel Sambucstatic int f1(float); // okay: considered distinct
15f4a2713aSLionel Sambucstatic int f2(float); // okay: considered distinct
16f4a2713aSLionel Sambucextern int f3(float); // okay: considered distinct
17f4a2713aSLionel Sambuc
18f4a2713aSLionel Sambucextern float v0;
19f4a2713aSLionel Sambuc// expected-error@-1{{redefinition of 'v0' with a different type: 'float' vs 'int'}}
20f4a2713aSLionel Sambuc// expected-note@Inputs/linkage-merge-sub.h:6{{previous definition is here}}
21f4a2713aSLionel Sambuc
22f4a2713aSLionel Sambucstatic float v1;
23f4a2713aSLionel Sambucstatic float v2;
24f4a2713aSLionel Sambucextern float v3;
25f4a2713aSLionel Sambuc
26f4a2713aSLionel Sambuctypedef float T0;
27