diff options
author | Chris Lattner <sabre@nondot.org> | 2007-12-18 08:16:44 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-12-18 08:16:44 +0000 |
commit | 2b9d2ca4ce53fffbe8a77c7db2fe4df5ccfb9fd4 (patch) | |
tree | cc70151907cd9fad63b5f8402a29f56629bf6252 /test/CodeGen/globalinit.c | |
parent | 9bfa73c5ab7bf4b0e749d04f29da6884e8d5bd9f (diff) |
local static vars are globals also. This fixes a testcase
reported by Seo.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45156 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/globalinit.c')
-rw-r--r-- | test/CodeGen/globalinit.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/CodeGen/globalinit.c b/test/CodeGen/globalinit.c index f47fd5c457..66bffd3dce 100644 --- a/test/CodeGen/globalinit.c +++ b/test/CodeGen/globalinit.c @@ -19,3 +19,10 @@ int (*mb_ptr2len) (char *p) = latin_ptr2len; char string[8] = "string"; // extend init char string2[4] = "string"; // truncate init +char *test(int c) { + static char buf[10]; + static char *bufptr = buf; + + return c ? buf : bufptr; +} + |