1// Purpose:
2// Ensure that debug information for a local variable does not hide
3// a global definition that has the same name.
4
5// REQUIRES: lldb
6// UNSUPPORTED: system-windows
7// RUN: %clang -std=gnu++11 -O0 -g %s -o %t
8// RUN: %dexter --fail-lt 1.0 -w \
9// RUN: --binary %t --debugger 'lldb' -v -- %s
10
11const int d = 100;
12
13extern int foo();
14
15int main() {
16 const int d = 4;
17 const float e = 4; // DexLabel("main")
18 const char *f = "Woopy";
19 return d + foo();
20}
21
22int foo() {
23 return d; // DexLabel("foo")
24}
25
26// DexExpectWatchValue('d', '4', on_line=ref('main'))
27// DexExpectWatchValue('d', '100', on_line=ref('foo'))
28
29

source code of cross-project-tests/debuginfo-tests/dexter-tests/deferred_globals.cpp