summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/redefine_extname.cpp
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2015-06-25 15:37:16 +0000
committerAaron Ballman <aaron@aaronballman.com>2015-06-25 15:37:16 +0000
commit9ec96a2f3fecd4872c0d002e163e424638e2ff67 (patch)
tree5121df7d36980def9c9cc1d3d1e8a8b4c167de52 /clang/test/CodeGenCXX/redefine_extname.cpp
parentecc728bde9a75d1e67e0693bc21afbeb564fcf27 (diff)
downloadbcm5719-llvm-9ec96a2f3fecd4872c0d002e163e424638e2ff67.tar.gz
bcm5719-llvm-9ec96a2f3fecd4872c0d002e163e424638e2ff67.zip
Fix #pragma redefine_extname when there is a local variable of the same name. The local should not be renamed, only the externally-available declaration should be.
Patch by Andrey Bokhanko! llvm-svn: 240653
Diffstat (limited to 'clang/test/CodeGenCXX/redefine_extname.cpp')
-rw-r--r--clang/test/CodeGenCXX/redefine_extname.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/clang/test/CodeGenCXX/redefine_extname.cpp b/clang/test/CodeGenCXX/redefine_extname.cpp
index 2b6b703a1b8..f76fe6252fe 100644
--- a/clang/test/CodeGenCXX/redefine_extname.cpp
+++ b/clang/test/CodeGenCXX/redefine_extname.cpp
@@ -8,7 +8,7 @@ extern "C" {
int statvfs64(struct statvfs64 *);
}
-void foo() {
+void some_func() {
struct statvfs64 st;
statvfs64(&st);
// Check that even if there is a structure with redefined name before the
@@ -16,3 +16,15 @@ void foo() {
// CHECK: call i32 @statvfs(%struct.statvfs64* %st)
}
+// This is a case when redefenition is deferred *and* we have a local of the
+// same name. PR23923.
+#pragma redefine_extname foo bar
+int f() {
+ int foo = 0;
+ return foo;
+}
+extern "C" {
+ int foo() { return 1; }
+// CHECK: define i32 @bar()
+}
+
OpenPOWER on IntegriCloud