aboutsummaryrefslogtreecommitdiff
path: root/tests/conformance/8-runtime/new_zero_index_traps.zc
blob: ee77d887a6c185154a1cd392fc8810f6047cf684 (plain) (blame)
1
2
3
4
5
6
// expect error: zy: index 0 out of range (length 0)
// spec 8.4: rt.new(0) has no words, so p[0] is outside
include rt;
void pn(int x) { rt.put_n(x); rt.put_c(10); }
fn main() { word* p = rt.new(0); int i = 0; pn(p[i]); return 0; }
// zc0: skip