[flang-commits] [flang] [llvm] [flang][PPC] Implement ieee_set_status and ieee_get_status for AIX (PR #215618)
Eugene Epshteyn via flang-commits
flang-commits at lists.llvm.org
Mon Aug 17 20:55:57 PDT 2026
================
@@ -0,0 +1,43 @@
+! Tests HLFIR code generation for ieee_get_status / ieee_set_status on PPC targets.
+!
+! REQUIRES: powerpc-registered-target
+! RUN: %flang_fc1 -triple powerpc64-ibm-aix -emit-hlfir -o - %s | FileCheck %s --check-prefix=CHECK-AIX
+! RUN: %flang_fc1 -triple powerpc64le-unknown-linux-gnu -emit-hlfir -o - %s | FileCheck %s --check-prefix=CHECK-LNX
+
+program test
+ use ieee_arithmetic
+ type(ieee_status_type) :: stat
+! LABEL: func.func @_QQmain
----------------
eugeneepshteyn wrote:
A few hardening suggestions for the new test:
- This `! LABEL:` is a dead directive — no active prefix (`CHECK-AIX`/`CHECK-LNX`) matches bare `LABEL`, so FileCheck never evaluates it. Make it per-prefix (`CHECK-AIX-LABEL:` / `CHECK-LNX-LABEL:`) or drop it.
- The hardcoded SSA names (`%c0`, `%c20`, `%c0_0`, `%c20_1`) match today's output but are brittle against constant renumbering; capturing is more robust, e.g. `%[[C20:.*]] = arith.constant 20 : index` and then using `%[[C20]]` in the `fir.coordinate_of` lines.
- A trailing `CHECK-LNX-NOT: @llvm.ppc.` would pin that the Linux path stays free of the AIX-only intrinsics.
- Consider adding a 32-bit `powerpc-ibm-aix` RUN line (see the comment on `kAIXFenvTSize`).
https://github.com/llvm/llvm-project/pull/215618
More information about the flang-commits
mailing list