diff options
| author | mlugg <mlugg@mlugg.co.uk> | 2023-03-05 12:39:32 +0000 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2023-04-12 12:06:19 -0400 |
| commit | ccf670c2b04ebeb9db43eb9f5c47c6cf03e4b1d0 (patch) | |
| tree | 3f7899bf6231500782af185ffe701ee66793e226 /test/cases/compile_errors | |
| parent | 602029bb2fb78048e46136784e717b57b8de8f2c (diff) | |
| download | zig-ccf670c2b04ebeb9db43eb9f5c47c6cf03e4b1d0.tar.gz zig-ccf670c2b04ebeb9db43eb9f5c47c6cf03e4b1d0.zip | |
Zir: implement explicit block_comptime instruction
Resolves: #7056
Diffstat (limited to 'test/cases/compile_errors')
| -rw-r--r-- | test/cases/compile_errors/branch_in_comptime_only_scope_uses_condbr_inline.zig | 7 | ||||
| -rw-r--r-- | test/cases/compile_errors/ignored_comptime_value.zig | 14 |
2 files changed, 7 insertions, 14 deletions
diff --git a/test/cases/compile_errors/branch_in_comptime_only_scope_uses_condbr_inline.zig b/test/cases/compile_errors/branch_in_comptime_only_scope_uses_condbr_inline.zig index 92e9620c99..9026d8c84f 100644 --- a/test/cases/compile_errors/branch_in_comptime_only_scope_uses_condbr_inline.zig +++ b/test/cases/compile_errors/branch_in_comptime_only_scope_uses_condbr_inline.zig @@ -16,7 +16,6 @@ pub export fn entry2() void { // backend=stage2 // target=native // -// :4:15: error: unable to resolve comptime value -// :4:15: note: condition in comptime branch must be comptime-known -// :11:11: error: unable to resolve comptime value -// :11:11: note: condition in comptime branch must be comptime-known +// :4:15: error: unable to evaluate comptime expression +// :4:13: note: operation is runtime due to this operand +// :11:11: error: unable to evaluate comptime expression diff --git a/test/cases/compile_errors/ignored_comptime_value.zig b/test/cases/compile_errors/ignored_comptime_value.zig index e1162459e6..3414d0861f 100644 --- a/test/cases/compile_errors/ignored_comptime_value.zig +++ b/test/cases/compile_errors/ignored_comptime_value.zig @@ -5,13 +5,7 @@ export fn b() void { comptime bar(); } fn bar() u8 { - const u32_max = @import("std").math.maxInt(u32); - - @setEvalBranchQuota(u32_max); - var x: u32 = 0; - while (x != u32_max) : (x +%= 1) {} - - return 0; + return 2; } // error @@ -21,6 +15,6 @@ fn bar() u8 { // :2:5: error: value of type 'comptime_int' ignored // :2:5: note: all non-void values must be used // :2:5: note: this error can be suppressed by assigning the value to '_' -// :5:17: error: value of type 'u8' ignored -// :5:17: note: all non-void values must be used -// :5:17: note: this error can be suppressed by assigning the value to '_' +// :5:5: error: value of type 'u8' ignored +// :5:5: note: all non-void values must be used +// :5:5: note: this error can be suppressed by assigning the value to '_' |
