Index: local-lexical-static.cpp =================================================================== --- local-lexical-static.cpp +++ local-lexical-static.cpp @@ -0,0 +1,24 @@ +// RUN: %clangxx -g -O0 %s -c -o %t.o +// RUN: llvm-dwarfdump -debug-info -verbose %t.o | FileCheck %s + +// static in local lexical block + +// CHECK: .debug_info contents: +// CHECK: DW_TAG_subprogram +// CHECK: DW_TAG_variable +// CHECK: DW_AT_name [DW_FORM_strp] ({{.*}}"localStaticVar") +// CHECK: DW_TAG_lexical_block +// CHECK: DW_AT_name [DW_FORM_strp] ({{.*}}"localStaticVar") + + +int g; +int main() +{ + static float localStaticVar = 50; + g = localStaticVar; + { + static float localStaticVar = 90; + g += localStaticVar; + } + return 0; +}