Adrian Prantl | 7e8f2ae | 2017-04-06 17:40:31 | [diff] [blame^] | 1 | // 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 | |
| 13 | void 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 | |
| 21 | int main(int argc, const char **argv) { |
| 22 | init_vla(23); |
| 23 | return 0; |
| 24 | } |