master
1const std = @import("std");
2const expect = std.testing.expect;
3
4test "static local variable" {
5 try expect(foo() == 1235);
6 try expect(foo() == 1236);
7}
8
9fn foo() i32 {
10 const S = struct {
11 var x: i32 = 1234;
12 };
13 S.x += 1;
14 return S.x;
15}
16
17// test