add compile error test for pointless discards

This commit is contained in:
Andrew Kelley 2022-09-13 10:01:17 -07:00
parent ebd082d3f6
commit b2e94de358

View File

@ -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