Remove the hack that avoided mangling static functions in extern C contexts.
Weather we should give C language linkage to functions and variables with
internal linkage probably depends on how much code assumes it. The standard
says they should have no language linkage, but gcc and msvc assign them
C language linkage.
This commit removes the hack that was preventing the mangling on static
functions declare in extern C contexts. It is an experiment to see if we
can implement the rules in the standard.
If it turns out that many users depend on these functions and variables
having C language linkage, we should change isExternC instead and try
to convince the CWG to change the standard.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175937 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/CodeGenCXX/c-linkage.cpp b/test/CodeGenCXX/c-linkage.cpp
index cec9e28..f6e64d9 100644
--- a/test/CodeGenCXX/c-linkage.cpp
+++ b/test/CodeGenCXX/c-linkage.cpp
@@ -15,11 +15,13 @@
extern "C" {
static void test2_f() {
}
- // This is not required by the standard, but users assume they know
- // the mangling of static functions in extern "C" contexts.
- // CHECK: define internal void @test2_f(
+ // CHECK: define internal void @_Z7test2_fv
+ static void test2_f(int x) {
+ }
+ // CHECK: define internal void @_Z7test2_fi
void test2_use() {
test2_f();
+ test2_f(42);
}
}