[clang] [CIR][NFC] Consolidate AArch64 tests (PR #180919)

Andrzej WarzyƄski via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 11 09:15:20 PST 2026


https://github.com/banach-space updated https://github.com/llvm/llvm-project/pull/180919

>From d5f7168efa315766c907ea8474cff1d9ae85900e Mon Sep 17 00:00:00 2001
From: Andrzej Warzynski <andrzej.warzynski at arm.com>
Date: Wed, 11 Feb 2026 11:14:47 +0000
Subject: [PATCH 1/2] [CIR][NFC] Consolidate AArch64 tests

As initiated in #180597 (*), ensure that CIR tests reuse the default
Clang lowering tests. To this end, consolidate the AArch64 tests for
unconstrained -fullfp16 builtins into:

  * clang/test/CodeGen/AArch64/neon/fullfp16.c

(*) See also https://github.com/llvm/llvm-project/issues/179952 for
more context.
---
 .../CodeGenBuiltins/AArch64/neon/fullfp16.c   | 35 -------------------
 clang/test/CodeGen/AArch64/neon/fullfp16.c    | 10 ++++++
 .../CodeGen/AArch64/v8.2a-fp16-intrinsics.c   |  7 ----
 3 files changed, 10 insertions(+), 42 deletions(-)
 delete mode 100644 clang/test/CIR/CodeGenBuiltins/AArch64/neon/fullfp16.c

diff --git a/clang/test/CIR/CodeGenBuiltins/AArch64/neon/fullfp16.c b/clang/test/CIR/CodeGenBuiltins/AArch64/neon/fullfp16.c
deleted file mode 100644
index 3943c4e57e1d1..0000000000000
--- a/clang/test/CIR/CodeGenBuiltins/AArch64/neon/fullfp16.c
+++ /dev/null
@@ -1,35 +0,0 @@
-// REQUIRES: aarch64-registered-target
-
-// RUN: %clang_cc1 -triple aarch64 -target-feature +fullfp16 -disable-O0-optnone -Werror -Wall -fclangir -emit-cir  -o - %s                                       | FileCheck %s --check-prefixes=ALL,CIR
-// RUN: %clang_cc1 -triple aarch64 -target-feature +fullfp16 -disable-O0-optnone -Werror -Wall -fclangir -emit-llvm -o - %s |  opt -S -passes=mem2reg,simplifycfg | FileCheck %s --check-prefixes=ALL,LLVM
-// RUN: %clang_cc1 -triple aarch64 -target-feature +fullfp16 -disable-O0-optnone -Werror -Wall           -emit-llvm -o - %s |  opt -S -passes=mem2reg,simplifycfg | FileCheck %s --check-prefixes=ALL,LLVM
-
-
-//=============================================================================
-// NOTES
-//
-// Tests for unconstrained intrinsics that require the fullfp16 extension.
-//
-// As these intrinsics expand to code with multiple compound and declaration
-// stmts, the LLVM output has been simplified with opt. `simplifycfg` was added
-// specifically for the CIR lowering path.
-//
-// Minor differences between RUNs (e.g. presence of `noundef` attached to
-// argumens, align` attribute attached to pointers), are matched using
-// catch-alls like {{.*}}.
-//
-// TODO: Merge this file with clang/test/CodeGen/AArch64/v8.2a-fp16-intrinsics.c
-// (the source of these tests).
-//=============================================================================
-
-#include <arm_fp16.h>
-
-// ALL-LABEL: @test_vabsh_f16
-float16_t test_vabsh_f16(float16_t a) {
-// CIR: {{%.*}}  = cir.fabs {{%.*}} : !cir.f16
-
-// LLVM-SAME: (half{{.*}} [[A:%.*]])
-// LLVM:  [[ABS:%.*]] =  call half @llvm.fabs.f16(half [[A]])
-// LLVM:  ret half [[ABS]]
-  return vabsh_f16(a);
-}
diff --git a/clang/test/CodeGen/AArch64/neon/fullfp16.c b/clang/test/CodeGen/AArch64/neon/fullfp16.c
index b4aca52372bf7..bbb9bcf267feb 100644
--- a/clang/test/CodeGen/AArch64/neon/fullfp16.c
+++ b/clang/test/CodeGen/AArch64/neon/fullfp16.c
@@ -31,6 +31,16 @@
 
 #include <arm_fp16.h>
 
+// ALL-LABEL: @test_vabsh_f16
+float16_t test_vabsh_f16(float16_t a) {
+// CIR: {{%.*}}  = cir.fabs {{%.*}} : !cir.f16
+
+// LLVM-SAME: (half{{.*}} [[A:%.*]])
+// LLVM:  [[ABS:%.*]] =  call half @llvm.fabs.f16(half [[A]])
+// LLVM:  ret half [[ABS]]
+  return vabsh_f16(a);
+}
+
 // ALL-LABEL: @test_vnegh_f16
 float16_t test_vnegh_f16(float16_t a) {
 // CIR: cir.unary(minus, {{.*}}) : !cir.f16
diff --git a/clang/test/CodeGen/AArch64/v8.2a-fp16-intrinsics.c b/clang/test/CodeGen/AArch64/v8.2a-fp16-intrinsics.c
index a4d544d26ae27..353f02195721f 100644
--- a/clang/test/CodeGen/AArch64/v8.2a-fp16-intrinsics.c
+++ b/clang/test/CodeGen/AArch64/v8.2a-fp16-intrinsics.c
@@ -7,13 +7,6 @@
 
 #include <arm_fp16.h>
 
-// CHECK-LABEL: test_vabsh_f16
-// CHECK:  [[ABS:%.*]] =  call half @llvm.fabs.f16(half %a)
-// CHECK:  ret half [[ABS]]
-float16_t test_vabsh_f16(float16_t a) {
-  return vabsh_f16(a);
-}
-
 // CHECK-LABEL: test_vceqzh_f16
 // CHECK:  [[TMP1:%.*]] = fcmp oeq half %a, 0xH0000
 // CHECK:  [[TMP2:%.*]] = sext i1 [[TMP1]] to i16

>From 5cc7b308cc809a819069222d010750bca5a73837 Mon Sep 17 00:00:00 2001
From: Andrzej Warzynski <andrzej.warzynski at arm.com>
Date: Wed, 11 Feb 2026 17:15:08 +0000
Subject: [PATCH 2/2] Fix whitespace

---
 clang/test/CodeGen/AArch64/neon/fullfp16.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/clang/test/CodeGen/AArch64/neon/fullfp16.c b/clang/test/CodeGen/AArch64/neon/fullfp16.c
index bbb9bcf267feb..f3268df2f4165 100644
--- a/clang/test/CodeGen/AArch64/neon/fullfp16.c
+++ b/clang/test/CodeGen/AArch64/neon/fullfp16.c
@@ -33,10 +33,10 @@
 
 // ALL-LABEL: @test_vabsh_f16
 float16_t test_vabsh_f16(float16_t a) {
-// CIR: {{%.*}}  = cir.fabs {{%.*}} : !cir.f16
+// CIR: {{%.*}} = cir.fabs {{%.*}} : !cir.f16
 
 // LLVM-SAME: (half{{.*}} [[A:%.*]])
-// LLVM:  [[ABS:%.*]] =  call half @llvm.fabs.f16(half [[A]])
+// LLVM:  [[ABS:%.*]] = call half @llvm.fabs.f16(half [[A]])
 // LLVM:  ret half [[ABS]]
   return vabsh_f16(a);
 }



More information about the cfe-commits mailing list