blob: 9c8e27715332e83cbe03b8dd878094dc3d6e5ceb [file] [log] [blame]
Adrian Prantl7e8f2ae2017-04-06 17:40:311// This test case verifies the debug location for variable-length arrays.
2// RUN: %clang %target_itanium_abi_host_triple -O0 -g %s -c -o %t.o
3// RUN: %clang %target_itanium_abi_host_triple %t.o -o %t.out
4// RUN: %test_debuginfo %s %t.out
5//
6// DEBUGGER: break 18
7// DEBUGGER: r
8// DEBUGGER: p vla[0]
9// CHECK: 23
10// DEBUGGER: p vla[1]
11// CHECK: 22
12
13void init_vla(int size) {
14 int i;
15 int vla[size];
16 for (i = 0; i < size; i++)
17 vla[i] = size-i;
18 vla[0] = size; // line 18
19}
20
21int main(int argc, const char **argv) {
22 init_vla(23);
23 return 0;
24}