From 8765c84df3cf60da79a515d73a3920ea9ec34289 Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Thu, 25 Jun 2015 15:37:16 +0000 Subject: 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 --- test/CodeGen/redefine_extname.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'test/CodeGen/redefine_extname.c') 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() + -- cgit v1.2.1