diff options
Diffstat (limited to 'tests/conformance/6-ownership/global_store_then_use.zc')
| -rw-r--r-- | tests/conformance/6-ownership/global_store_then_use.zc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/conformance/6-ownership/global_store_then_use.zc b/tests/conformance/6-ownership/global_store_then_use.zc new file mode 100644 index 0000000..7aebc2c --- /dev/null +++ b/tests/conformance/6-ownership/global_store_then_use.zc @@ -0,0 +1,7 @@ +// expect error: x: used after it was given away +// spec 6.9.2 +include rt; +void pn(int x) { rt.put_n(x); rt.put_c(10); } +int* g; +fn main() { int* x = rt.new(1); x[0] = 2; g = d*x; pn(x[0]); return 0; } +// zc0: skip |
