From 3204d00a5e7fe119b690e921138a439fb84dff5b Mon Sep 17 00:00:00 2001 From: Veikka Tuominen Date: Mon, 27 Jun 2022 18:32:59 +0300 Subject: move passing stage1 compile error tests to stage2 --- test/cases/compile_errors/assign_through_constant_pointer.zig | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 test/cases/compile_errors/assign_through_constant_pointer.zig (limited to 'test/cases/compile_errors/assign_through_constant_pointer.zig') diff --git a/test/cases/compile_errors/assign_through_constant_pointer.zig b/test/cases/compile_errors/assign_through_constant_pointer.zig new file mode 100644 index 0000000000..21924ae4da --- /dev/null +++ b/test/cases/compile_errors/assign_through_constant_pointer.zig @@ -0,0 +1,10 @@ +export fn f() void { + var cstr = "Hat"; + cstr[0] = 'W'; +} + +// error +// backend=stage2 +// target=native +// +// :3:13: error: cannot assign to constant -- cgit v1.2.3