diff --git a/test/cases/compile_errors/pointless discard.zig b/test/cases/compile_errors/pointless discard.zig new file mode 100644 index 0000000000..048bf8ac8d --- /dev/null +++ b/test/cases/compile_errors/pointless discard.zig @@ -0,0 +1,12 @@ +export fn foo() void { + var x: i32 = 1234; + x += 1; + _ = x; +} + +// error +// backend=stage2 +// target=native +// +// :4:9: error: pointless discard of local variable +// :3:5: note: used here