tests: move compile errors not planned for stage2

This commit is contained in:
Veikka Tuominen
2022-06-28 20:58:21 +03:00
committed by Jakub Konka
parent cc3336c784
commit 90ae37cc00
37 changed files with 10 additions and 11 deletions

View File

@@ -13203,7 +13203,6 @@ fn zirCondbr(
defer tracy.end();
const inst_data = sema.code.instructions.items(.data)[inst].pl_node;
const src = inst_data.src();
const cond_src: LazySrcLoc = .{ .node_offset_if_cond = inst_data.src_node };
const extra = sema.code.extraData(Zir.Inst.CondBr, inst_data.payload_index);
@@ -13213,7 +13212,7 @@ fn zirCondbr(
const uncasted_cond = try sema.resolveInst(extra.data.condition);
const cond = try sema.coerce(parent_block, Type.bool, uncasted_cond, cond_src);
if (try sema.resolveDefinedValue(parent_block, src, cond)) |cond_val| {
if (try sema.resolveDefinedValue(parent_block, cond_src, cond)) |cond_val| {
const body = if (cond_val.toBool()) then_body else else_body;
// We use `analyzeBodyInner` since we want to propagate any possible
// `error.ComptimeBreak` to the caller.

View File

@@ -0,0 +1,9 @@
export fn entry() void {
if (2 == undefined) {}
}
// error
// backend=stage2
// target=native
//
// :2:11: error: use of undefined value here causes undefined behavior

View File

@@ -1,9 +0,0 @@
export fn entry() void {
if (2 == undefined) {}
}
// error
// backend=stage1
// target=native
//
// tmp.zig:2:11: error: use of undefined value here causes undefined behavior