From c1a98cd65d48693c9cfce5fbc5e5f5a1dbf4c1b7 Mon Sep 17 00:00:00 2001 From: Jakub Konka Date: Wed, 27 Apr 2022 12:41:05 +0200 Subject: test: set case name from initial filename for a sequence Port more incremental tests. --- test/incremental/assert_function.9.zig | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 test/incremental/assert_function.9.zig (limited to 'test/incremental/assert_function.9.zig') diff --git a/test/incremental/assert_function.9.zig b/test/incremental/assert_function.9.zig new file mode 100644 index 0000000000..c754bb7711 --- /dev/null +++ b/test/incremental/assert_function.9.zig @@ -0,0 +1,22 @@ +pub fn main() void { + assert(add(3, 4) == 20); +} + +fn add(a: u32, b: u32) u32 { + const x: u32 = blk: { + const c = a + b; // 7 + const d = a + c; // 10 + const e = d + b; // 14 + break :blk e; + }; + const y = x + a; // 17 + const z = y + a; // 20 + return z; +} + +pub fn assert(ok: bool) void { + if (!ok) unreachable; // assertion failure +} + +// run +// -- cgit v1.2.3