swift
65896e72 - [rebranch] Adjust to "[AsmWriter] Change the output syntax of floating-point literals. (#190649)"

Commit
35 days ago
[rebranch] Adjust to "[AsmWriter] Change the output syntax of floating-point literals. (#190649)" ``` ConstValues/SectionIR.swift:64: expected: // CHECK: @"$s9SectionIR13floatLiteral1Sfvp" = {{.*}}constant %TSf <{ float 0x40091EB860000000 }>, section "mysection" actual: @"$s9SectionIR13floatLiteral1Sfvp" = hidden constant %TSf <{ float 3.140000e+00 }>, section "mysection", align 4 ``` The offending commit reworked `writeAPFloatInternal` so that the legacy hexadecimal literal form is never emitted. A decimal literal is now used whenever reparsing the 6-digit decimal string *in the value's own semantics* yields a bit-identical `APFloat`; only otherwise does the printer fall back to the new exact `f0x...` form. Previously `float` was widened to `double` and printed as a 64-bit hex pattern. `float 3.140000e+00` parses to 0x4048F5C3, which widens to exactly 0x40091EB860000000, so the new spelling denotes the very same bits: the change is purely cosmetic, not a loss of precision. Re-pinning the exact decimal spelling matches how these tests already spell the neighboring `double 2.718000e+00` and integer constants, and mirrors the downstream adaptation of a clang test in llvm-project b91eb068c00c. See https://github.com/llvm/llvm-project/commit/41c214f0b1151d74b660e5218b9ef066f4207492 (https://github.com/llvm/llvm-project/pull/190649). Assisted-by: Claude Code Cherry-picked to main, which is still paired with llvm-project stable/21.x. The old AsmWriter there still prints the widened 64-bit hex pattern, so re-pinning these four CHECK lines to the decimal spelling alone would fail on main while passing on rebranch. Match either spelling with a FileCheck alternation instead, so one test file works against both LLVM versions. Both alternatives denote the same bits (float 3.140000e+00 parses to 0x4048F5C3, which widens to exactly 0x40091EB860000000), so nothing is loosened beyond the spelling. Collapse this to the decimal form alone when main moves to LLVM 23.
Author
Committer
Parents
Loading