aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/tests2/78_vla_label.c21
-rw-r--r--tests/tests2/78_vla_label.expect2
-rw-r--r--tests/tests2/Makefile3
3 files changed, 25 insertions, 1 deletions
diff --git a/tests/tests2/78_vla_label.c b/tests/tests2/78_vla_label.c
new file mode 100644
index 0000000..0908e1b
--- /dev/null
+++ b/tests/tests2/78_vla_label.c
@@ -0,0 +1,21 @@
+#include <stdio.h>
+
+/* This test segfaults as of April 27, 2015. */
+
+void f(int argc)
+{
+ char test[argc];
+ if(0)
+ label:
+ printf("boom!\n");
+ if(argc-- == 0)
+ return;
+ goto label;
+}
+
+int main()
+{
+ f(2);
+
+ return 0;
+}
diff --git a/tests/tests2/78_vla_label.expect b/tests/tests2/78_vla_label.expect
new file mode 100644
index 0000000..9a8c159
--- /dev/null
+++ b/tests/tests2/78_vla_label.expect
@@ -0,0 +1,2 @@
+boom!
+boom!
diff --git a/tests/tests2/Makefile b/tests/tests2/Makefile
index 87daf7b..470716b 100644
--- a/tests/tests2/Makefile
+++ b/tests/tests2/Makefile
@@ -96,7 +96,8 @@ TESTS = \
74_nocode_wanted.test \
75_array_in_struct_init.test \
76_dollars_in_identifiers.test \
- 77_push_pop_macro.test
+ 77_push_pop_macro.test \
+ 78_vla_label.test
# 34_array_assignment.test -- array assignment is not in C standard