aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGenCXX/mangle.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2011-03-22 06:34:45 +0000
committerJohn McCall <rjmccall@apple.com>2011-03-22 06:34:45 +0000
commit74990f45b0bc57fca81f908efb13d2b6c6350f03 (patch)
tree50a10cf5ec55dd718a51b008505c34dce1aa3433 /test/CodeGenCXX/mangle.cpp
parent5fff46b65389f7e7eb576e47c7bc3ca67326a206 (diff)
File-scope static functions need to be mangled with 'L' so that
they don't collide with file-scope extern functions from the same translation unit. This is basically a matter of applying the same logic to FunctionDecls as we were previously applying to VarDecls. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128072 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/mangle.cpp')
-rw-r--r--test/CodeGenCXX/mangle.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/test/CodeGenCXX/mangle.cpp b/test/CodeGenCXX/mangle.cpp
index ec496fe1f7..36bf7a8b05 100644
--- a/test/CodeGenCXX/mangle.cpp
+++ b/test/CodeGenCXX/mangle.cpp
@@ -373,7 +373,7 @@ namespace test1 {
template void f(X<int>);
}
-// CHECK: define internal void @_Z27functionWithInternalLinkagev()
+// CHECK: define internal void @_ZL27functionWithInternalLinkagev()
static void functionWithInternalLinkage() { }
void g() { functionWithInternalLinkage(); }
@@ -647,3 +647,17 @@ namespace test23 {
void f(vpca5 volatile (&)[10]) {}
// CHECK: define void @_ZN6test231fERA10_A5_VKPv(
}
+
+namespace test24 {
+ void test0() {
+ extern int foo();
+ // CHECK: call i32 @_ZN6test243fooEv()
+ foo();
+ }
+
+ static char foo() {}
+ void test1() {
+ // CHECK: call signext i8 @_ZN6test24L3fooEv()
+ foo();
+ }
+}