diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2010-05-26 21:45:50 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2010-05-26 21:45:50 +0000 |
commit | 4c464b9702af8ec5e76d5eb184e76df1d40c23ec (patch) | |
tree | b7f8a1d2f3432922eee057be149b02d36d6a1d46 /test/CodeGenCXX/static-local-in-local-class.cpp | |
parent | f0af777aff72b58333edcf258e30998e865bdef3 (diff) |
Patch to fix a irgen crash accessing an initialized local static
variable in a local function. Fixes pr7101.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104743 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/static-local-in-local-class.cpp')
-rw-r--r-- | test/CodeGenCXX/static-local-in-local-class.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/CodeGenCXX/static-local-in-local-class.cpp b/test/CodeGenCXX/static-local-in-local-class.cpp index d9e044ce9d..ebf560ab98 100644 --- a/test/CodeGenCXX/static-local-in-local-class.cpp +++ b/test/CodeGenCXX/static-local-in-local-class.cpp @@ -19,3 +19,15 @@ void X::f() { } (void)i; } + +// pr7101 +void foo() { + static int n = 0; + struct Helper { + static void Execute() { + n++; + } + }; + Helper::Execute(); +} + |