about summary refs log tree commit diff
path: root/src/test/codegen/stack-alloc-string-slice.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/codegen/stack-alloc-string-slice.cc')
-rw-r--r--src/test/codegen/stack-alloc-string-slice.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/test/codegen/stack-alloc-string-slice.cc b/src/test/codegen/stack-alloc-string-slice.cc
new file mode 100644
index 00000000000..01eae9b16bb
--- /dev/null
+++ b/src/test/codegen/stack-alloc-string-slice.cc
@@ -0,0 +1,12 @@
+#include <stddef.h>
+
+struct slice {
+  char const *p;
+  size_t len;
+};
+
+extern "C"
+void test() {
+  struct slice s = { .p = "hello",
+                     .len = 5 };
+}