[clang] [CIR] Only emit FP math intrinsics when precision/errno settings allow it (PR #169424)

Andy Kaylor via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 1 16:46:06 PST 2025


================
@@ -0,0 +1,75 @@
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -Wno-unused-value -fclangir -emit-cir -fmath-errno %s -o %t.cir
+// RUN: FileCheck --input-file=%t.cir %s -check-prefix=CIR-ERRNO
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -Wno-unused-value -fclangir -emit-cir -ffast-math %s -o %t.cir
----------------
andykaylor wrote:

```suggestion
// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -Wno-unused-value -fclangir -emit-cir %s -o %t-no-errno.cir
```
You're using the same output file for all of these RUN lines. Can you give them unique names?

Also, you don't need to pass `-ffast-math` the absence of `-fmath-errno` should be sufficient.

https://github.com/llvm/llvm-project/pull/169424


More information about the cfe-commits mailing list