| ... | ... | @@ -172,4 +172,23 @@ pub fn addCases(ctx: *TestContext) !void { |
| 172 | 172 | \\} |
| 173 | 173 | , ""); |
| 174 | 174 | } |
| 175 | |
| 176 | { |
| 177 | var case = ctx.exeUsingLlvmBackend("for loop", linux_x64); |
| 178 | |
| 179 | case.addCompareOutput( |
| 180 | \\fn assert(ok: bool) void { |
| 181 | \\ if (!ok) unreachable; |
| 182 | \\} |
| 183 | \\ |
| 184 | \\export fn main() c_int { |
| 185 | \\ var x: u32 = 0; |
| 186 | \\ for ("hello") |_| { |
| 187 | \\ x += 1; |
| 188 | \\ } |
| 189 | \\ assert("hello".len == x); |
| 190 | \\ return 0; |
| 191 | \\} |
| 192 | , ""); |
| 193 | } |
| 175 | 194 | } |