diff options
| author | Devang Patel <dpatel@apple.com> | 2010-02-17 02:20:34 +0000 |
|---|---|---|
| committer | Devang Patel <dpatel@apple.com> | 2010-02-17 02:20:34 +0000 |
| commit | ca55a042732f1fa06a3516a3e80704cfcb22fdf9 (patch) | |
| tree | c0eb79a27f9c992120c1d0d2b1cc3b72d8d98648 /llvm/test/FrontendC | |
| parent | 8aefcbed49c61b3567f58789b33de2b1fa0734dc (diff) | |
| download | bcm5719-llvm-ca55a042732f1fa06a3516a3e80704cfcb22fdf9.tar.gz bcm5719-llvm-ca55a042732f1fa06a3516a3e80704cfcb22fdf9.zip | |
Before setting scope end marker, pay attention to scope begin marker and existing scope end marker, if any. Scope must begin before it ends and nested inlined scope do not truncate surrounding scope.
llvm-svn: 96445
Diffstat (limited to 'llvm/test/FrontendC')
| -rw-r--r-- | llvm/test/FrontendC/2010-02-16-DbgVarScope.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/llvm/test/FrontendC/2010-02-16-DbgVarScope.c b/llvm/test/FrontendC/2010-02-16-DbgVarScope.c new file mode 100644 index 00000000000..1d912d0f5e5 --- /dev/null +++ b/llvm/test/FrontendC/2010-02-16-DbgVarScope.c @@ -0,0 +1,30 @@ +// RUN: %llvmgcc -S -O0 -g %s -o - | \ +// RUN: llc --disable-fp-elim -o %t.s -O0 -relocation-model=pic +// RUN: %compile_c %t.s -o %t.o +// RUN: %link %t.o -o %t.exe +// RUN: echo {break 24\nrun\np loc\n} > %t.in +// RN: gdb -q -batch -n -x %t.in %t.exe | tee %t.out | \ +// RN: grep {$1 = 1} + +int g1 = 1; +int g2 = 2; + +int __attribute__((always_inline)) bar() { + return g2 - g1; +} +void foobar() {} + +void foo(int s) { + unsigned loc = 0; + if (s) { + loc = 1; + foobar(); + } else { + loc = bar(); + foobar(); + } +} + +int main() { + foo(0); +} |

