0
Fork 0
mirror of https://codeberg.org/ziglang/zig synced 2026-11-18 07:05:05 +00:00
zig/test
Evan Haas dce612ac2b translate-c: Ensure assignments are within a block when necessary
Ensures that if an assignment statement is the sole statement within a
C if statement, for loop, do loop, or do while loop, then when translated
it resides within a block, even though it does not in the original C.

Fixes the following invalid translation:

`if (1) if (1) 2;` -> `if (true) if (true) _ = @as(c_int, 2);`

To this:
```zig
    if (true) if (true) {
        _ = @as(c_int, 2);
    };
```

Fixes #8159
History 2021-03-22 10:48:08 +02:00
..
src tests: Use {s} instead of {} when formatting strings 2021-01-02 17:12:57 -07:00
stage1 std: Replace testing fns for floating-point values 2021-03-14 17:23:47 -04:00
stage2 cbe tests: fix test on windows 2021-03-18 22:45:01 +02:00
standalone require specifier for arrayish types 2021-02-09 22:25:52 -08:00
assemble_and_link.zig update std lib to new Target API 2020-02-28 14:51:54 -05:00
cli.zig test-cli: Remove temporary directory after tests 2021-03-17 10:27:41 +01:00
compare_output.zig Reduce use of deprecated IO types 2021-01-07 23:48:58 -08:00
compile_errors.zig Convert inline fn to callconv(.Inline) everywhere 2021-02-10 20:06:12 -07:00
gen_h.zig run zig fmt on src/ and test/ 2020-10-31 12:21:49 +02:00
run_translated_c.zig translate-c: Ensure assignments are within a block when necessary 2021-03-22 10:48:08 +02:00
runtime_safety.zig Replace @TagType uses, mostly with std.meta.Tag 2021-01-30 22:26:44 +02:00
stack_traces.zig std.crypto.random: introduce fork safety 2020-12-18 15:54:01 -07:00
standalone.zig zld: temporarily disable testing shared lib linking 2021-03-18 11:10:31 +01:00
tests.zig Replace @TagType uses, mostly with std.meta.Tag 2021-01-30 22:26:44 +02:00
translate_c.zig translate-c: Ensure assignments are within a block when necessary 2021-03-22 10:48:08 +02:00