diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2015-06-25 15:37:16 +0000 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2015-06-25 15:37:16 +0000 |
commit | 8765c84df3cf60da79a515d73a3920ea9ec34289 (patch) | |
tree | 8dd8eb516d51bdd8003d0250ffdcd522b56b70ac /test/CodeGen/redefine_extname.c | |
parent | daf37e652765eafe4d7ff177aa4f4989fa423421 (diff) | |
download | clang-8765c84df3cf60da79a515d73a3920ea9ec34289.tar.gz |
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!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240653 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/redefine_extname.c')
-rw-r--r-- | test/CodeGen/redefine_extname.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/CodeGen/redefine_extname.c b/test/CodeGen/redefine_extname.c index a91e5b836a..ad4106dd45 100644 --- a/test/CodeGen/redefine_extname.c +++ b/test/CodeGen/redefine_extname.c @@ -13,3 +13,14 @@ int fish() { return fake() + __PRAGMA_REDEFINE_EXTNAME + name; } // CHECK: call i32 @real() // Check that this also works with variables names // CHECK: load i32, i32* @alias + +// 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 int foo() { return 1; } +// CHECK: define i32 @bar() + |