0
Fork 0
mirror of https://codeberg.org/ziglang/zig synced 2026-11-18 07:05:05 +00:00
zig/test
Evan Haas d4d21dd46d translate-c: better handling of int -> enum casts
In std.meta.cast when casting to an enum type from an integer type, first
do a C-style cast from the source value to the tag type of the enum.
This ensures that we don't get an error due to the source value not being
representable by the enum.

In transCCast() use std.meta.cast instead of directly emitting the cast
operation since the enum's underlying type may not be known at translation
time due to an MSVC bug, see https://github.com/ziglang/zig/issues/8003

Fixes #6011
History 2021-04-15 22:46:22 -04:00
..
src tests: Use {s} instead of {} when formatting strings 2021-01-02 17:12:57 -07:00
stage1 Merge remote-tracking branch 'origin/llvm12' 2021-04-14 14:41:57 -07:00
stage2 stage2 ARM: Add fibonacci test 2021-04-11 10:19:36 +02:00
standalone Add standalone test for interdep C archives 2021-04-13 13:32:59 +02: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 Allow async in nosuspend scope 2021-02-16 23:43:36 -05: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: better handling of int -> enum casts 2021-04-15 22:46:22 -04:00
runtime_safety.zig Replace @TagType uses, mostly with std.meta.Tag 2021-01-30 22:26:44 +02:00
stack_traces.zig test-stack-traces: enable elf/dwarf platforms 2021-04-12 17:18:56 -04:00
standalone.zig Add standalone test for interdep C archives 2021-04-13 13:32:59 +02:00
tests.zig Merge remote-tracking branch 'origin/master' into llvm12 2021-04-11 17:40:19 -04:00
translate_c.zig translate-c: better handling of int -> enum casts 2021-04-15 22:46:22 -04:00