Happy to see the migration! This is an issue I never got around creating on Github so it is not a duplicate.
The Floating Point Operations documentation shows how to switch blocks to Optimized mode. It explains "For this test we have to separate code into two object files - otherwise the optimizer figures out all the values at compile-time, which operates in strict mode."
It then creates an object file with the Strict and Optimized function definitions, and in a separate .zig file declares main which calls these two functions. The problem is that this second program's output is missing, which is crucial since it shows the different output between the Strict and Optimized functions.
Debugging the issue I noticed that the problem was that the float_mode_exe.zig (the example whose output is missing) doesn't contain the necessary // exe=succeed and // optimize=ReleaseFast instructions but instead only a // syntax instruction. The reason for this (I'm assuming) is that the automatic test runner producing these parts of the langref runs each code example independently and is therefore not able to link to the object file created by float_mode_obj.zig. I checked the rest of the documentation and found that this is the only code example requiring this functionality and missing its output because of this.
Simple (incremental) solution:
Add the shell with the build command and the expected output to the langref manually as I've done in #25662. This is an immediate improvement to the documentation so following the Zen Incremental improvements would probably be worth it at least temporarily.
Complete (but possibly unnecessary) solution:
Somehow allow langref code samples to use artifacts (such as object files) created by other samples. Maybe via declaring dependencies?
Happy to see the migration! This is an issue I never got around creating on Github so it is not a duplicate.
The [Floating Point Operations documentation](https://ziglang.org/documentation/master/#Floating-Point-Operations) shows how to switch blocks to `Optimized` mode. It explains "For this test we have to separate code into two object files - otherwise the optimizer figures out all the values at compile-time, which operates in strict mode."
It then creates an object file with the `Strict` and `Optimized` function definitions, and in a separate .zig file declares main which calls these two functions. The problem is that this second program's output is missing, which is crucial since it shows the different output between the `Strict` and `Optimized` functions.
[Debugging the issue](https://github.com/ziglang/zig/pull/25662) I noticed that the problem was that the [float_mode_exe.zig](https://codeberg.org/ziglang/zig/src/branch/master/doc/langref/float_mode_exe.zig) (the example whose output is missing) doesn't contain the necessary `// exe=succeed` and `// optimize=ReleaseFast` instructions but instead only a `// syntax` instruction. The reason for this (I'm assuming) is that the automatic test runner producing these parts of the langref runs each code example independently and is therefore not able to link to the object file created by [float_mode_obj.zig](https://codeberg.org/ziglang/zig/src/branch/master/doc/langref/float_mode_obj.zig). I checked the rest of the documentation and found that this is the only code example requiring this functionality and missing its output because of this.
Simple (incremental) solution:
Add the shell with the build command and the expected output to the langref manually as I've done in [#25662](https://github.com/ziglang/zig/pull/25662). This is an immediate improvement to the documentation so following the Zen _Incremental improvements_ would probably be worth it at least temporarily.
Complete (but possibly unnecessary) solution:
Somehow allow langref code samples to use artifacts (such as object files) created by other samples. Maybe via declaring dependencies?