bolt/deps/llvm-18.1.8/cross-project-tests/debuginfo-tests/dexter-tests/vla.c

24 lines
588 B
C
Raw Normal View History

2025-02-14 19:21:04 +01:00
// This test case verifies the debug location for variable-length arrays.
// REQUIRES: lldb
// UNSUPPORTED: system-windows
//
// RUN: %clang -std=gnu11 -O0 -glldb %s -o %t
// RUN: %dexter --fail-lt 1.0 -w --binary %t --debugger 'lldb' -- %s
void init_vla(int size) {
int i;
int vla[size];
for (i = 0; i < size; i++)
vla[i] = size-i;
vla[0] = size; // DexLabel('end_init')
}
int main(int argc, const char **argv) {
init_vla(23);
return 0;
}
// DexExpectWatchValue('vla[0]', '23', on_line=ref('end_init'))
// DexExpectWatchValue('vla[1]', '22', on_line=ref('end_init'))