summaryrefslogtreecommitdiffstats
path: root/debuginfo-tests/dexter-tests/vla.c
diff options
context:
space:
mode:
Diffstat (limited to 'debuginfo-tests/dexter-tests/vla.c')
-rw-r--r--debuginfo-tests/dexter-tests/vla.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/debuginfo-tests/dexter-tests/vla.c b/debuginfo-tests/dexter-tests/vla.c
new file mode 100644
index 00000000000..a06bf3c8170
--- /dev/null
+++ b/debuginfo-tests/dexter-tests/vla.c
@@ -0,0 +1,22 @@
+// This test case verifies the debug location for variable-length arrays.
+// REQUIRES: system-linux, lldb
+//
+// RUN: %dexter --fail-lt 1.0 -w \
+// RUN: --builder clang-c --debugger 'lldb' --cflags "-O0 -glldb" -- %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='end_init')
+// DexExpectWatchValue('vla[1]', '22', on_line='end_init')
+
OpenPOWER on IntegriCloud