Author: Pranjal Srivastava
Date: 2026-10-30T11:17:41+01:00
New Revision: 7200a3381f84756074ac1aa8564a22fbdda2ae79

URL: 
https://github.com/llvm/llvm-project/commit/7200a3381f84756074ac1aa8564a22fbdda2ae79
DIFF: 
https://github.com/llvm/llvm-project/commit/7200a3381f84756074ac1aa8564a22fbdda2ae79.diff

LOG: [clang][test][NFC] Fix missing colons in FileCheck directives in 
arithmetic-fence-builtin.c (#236646)

In `clang/test/CodeGen/arithmetic-fence-builtin.c`, seven `CHECK-NEXT`
directives were missing colons (`:`), causing `FileCheck` to silently
ignore them.

Enabling these checks exposed two issues:
1. For `v = b + __arithmetic_fence(a*a);`, `fmul` is followed by `call
{{.*}} @llvm.arithmetic.fence.f32` and `fadd`, before the `fptosi`
conversion. Hence, the `CHECK-NEXT: fptosi` immediately after `fmul`
failed. Added `CHECKFAST-NEXT` checks for the fence call and `fadd`.
2. Change `CHECK-NEXT` to `CHECKFAST-NEXT` on the trailing instructions
in `addit()` because the non-fast-math `RUN` lines only run the default
`CHECK` prefix (with `--implicit-check-not="llvm.arithmetic.fence"`) and
do not match the intermediate `CHECKFAST`/`CHECKPP`/`CHECKNP`
instructions in `addit()`.

Assisted-by: Gemini

Added: 
    

Modified: 
    clang/test/CodeGen/arithmetic-fence-builtin.c

Removed: 
    


################################################################################
diff  --git a/clang/test/CodeGen/arithmetic-fence-builtin.c 
b/clang/test/CodeGen/arithmetic-fence-builtin.c
index 5339b2061d6bd..97d1a9e585926 100644
--- a/clang/test/CodeGen/arithmetic-fence-builtin.c
+++ b/clang/test/CodeGen/arithmetic-fence-builtin.c
@@ -61,17 +61,19 @@ int addit(float a, float b) {
   v = b + __arithmetic_fence(a*a); // Fence blocks recognition of FMA
   // CHECKPP: fmul
   // CHECKNP: fmul
+  // CHECKFAST-NEXT: call{{.*}} float @llvm.arithmetic.fence.f32
+  // CHECKFAST-NEXT: fadd
 
   b = (a);
   (a) = b;
-  // CHECK-NEXT fptosi
-  // CHECK-NEXT store i32
-  // CHECK-NEXT load float
-  // CHECK-NEXT store float
-  // CHECK-NEXT load float
-  // CHECK-NEXT store float
+  // CHECKFAST-NEXT: fptosi
+  // CHECKFAST-NEXT: store i32
+  // CHECKFAST-NEXT: load float
+  // CHECKFAST-NEXT: store float
+  // CHECKFAST-NEXT: load float
+  // CHECKFAST-NEXT: store float
   return 0;
-  // CHECK-NEXT ret i32 0
+  // CHECKFAST-NEXT: ret i32 0
 }
 int addit1(int a, int b) {
   // CHECK: define {{.*}}@addit1(i32 noundef %a, i32 noundef %b{{.*}}


        
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to