about summary refs log tree commit diff
path: root/src/test/codegen/stack-alloc-string-slice.cc
diff options
context:
space:
mode:
authorGraydon Hoare <graydon@mozilla.com>2013-07-16 17:42:28 -0700
committerGraydon Hoare <graydon@mozilla.com>2013-07-16 17:44:57 -0700
commit40f74341f3ba2cee2afedb31014ee14432d700cd (patch)
treeef23525a041d4adc8f8898ffd9e375962cee7776 /src/test/codegen/stack-alloc-string-slice.cc
parent53e934c2ab773eaf61da331893d176aa3e62230b (diff)
downloadrust-40f74341f3ba2cee2afedb31014ee14432d700cd.tar.gz
rust-40f74341f3ba2cee2afedb31014ee14432d700cd.zip
test: new codegen tests, rename hello.
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 };
+}