diff options
| author | Fariborz Jahanian <fjahanian@apple.com> | 2010-11-30 23:07:14 +0000 |
|---|---|---|
| committer | Fariborz Jahanian <fjahanian@apple.com> | 2010-11-30 23:07:14 +0000 |
| commit | 3a4ea9a76ccb85c343427118fa1c457bd105b3ee (patch) | |
| tree | f09e28b92760c35ef2bc53067dc6166507ae110d /clang/test/CodeGen | |
| parent | c0f3379ae06f37f090ab55e31e8a876dd69cd1ba (diff) | |
| download | bcm5719-llvm-3a4ea9a76ccb85c343427118fa1c457bd105b3ee.tar.gz bcm5719-llvm-3a4ea9a76ccb85c343427118fa1c457bd105b3ee.zip | |
Declaring local static in global block
literal declaration caused crash in CodeGen.
This patch fixes it. pr8707
llvm-svn: 120486
Diffstat (limited to 'clang/test/CodeGen')
| -rw-r--r-- | clang/test/CodeGen/blockwithlocalstatic.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/clang/test/CodeGen/blockwithlocalstatic.c b/clang/test/CodeGen/blockwithlocalstatic.c new file mode 100644 index 00000000000..1fdaaf37a1b --- /dev/null +++ b/clang/test/CodeGen/blockwithlocalstatic.c @@ -0,0 +1,19 @@ +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fblocks -emit-llvm -o - %s | FileCheck %s +// pr8707 + +// CHECK: @__block_global_0.test = internal global i32 +int (^block)(void) = ^ { + static int test=0; + return test; +}; +// CHECK: @__block_global_1.test = internal global i32 +void (^block1)(void) = ^ { + static int test = 2; + return; +}; +// CHECK: @__block_global_2.test = internal global i32 +int (^block2)(void) = ^ { + static int test = 5; + return test; +}; + |

