aboutsummaryrefslogtreecommitdiff
path: root/tests/conformance/3-expressions/ptr_deref_struct_is_address.zc
diff options
context:
space:
mode:
Diffstat (limited to 'tests/conformance/3-expressions/ptr_deref_struct_is_address.zc')
-rw-r--r--tests/conformance/3-expressions/ptr_deref_struct_is_address.zc11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/conformance/3-expressions/ptr_deref_struct_is_address.zc b/tests/conformance/3-expressions/ptr_deref_struct_is_address.zc
new file mode 100644
index 0000000..f495fc5
--- /dev/null
+++ b/tests/conformance/3-expressions/ptr_deref_struct_is_address.zc
@@ -0,0 +1,11 @@
+// expect: 1/
+include rt;
+void pn(int x) { rt.put_n(x); rt.put_c(10); }
+struct point { int x; int y; }
+fn main() {
+ point* p = rt.new(point, 4);
+ pn((int)(*(p + 2)) == (int)(p + 2));
+ rt.free(p);
+ return 0;
+}
+// zc0: skip