[flang-commits] [flang] [flang][test] Run Driver/fveclib-codegen.f90 for x86_64 (PR #103730)
Rainer Orth via flang-commits
flang-commits at lists.llvm.org
Wed Aug 14 11:11:43 PDT 2024
https://github.com/rorth updated https://github.com/llvm/llvm-project/pull/103730
>From 6e04d8e998f97ece7590a97565525d5b93af60a2 Mon Sep 17 00:00:00 2001
From: Rainer Orth <ro at gcc.gnu.org>
Date: Wed, 14 Aug 2024 11:26:16 +0200
Subject: [PATCH 1/2] [flang][test] Run Driver/fveclib-codegen.f90 for x86_64
`Flang :: Driver/fveclib-codegen.f90` currently `FAIL`s on SPARC, both
Solaris/sparcv9 and Linux/sparc64:
```
bin/flang-new -S -Ofast -fveclib=LIBMVEC -o - /vol/llvm/src/llvm-project/local/flang/test/Driver/fveclib-codegen.f90
flang/test/Driver/fveclib-codegen.f90:11:10: error: CHECK: expected string not found in input
! CHECK: _ZGVbN4vv_powf
^
```
The code in question only contains calls to `powf`. Given that `glibc`
only supports `libmvec` on `aarch64` and `x86_64`, this test needs to
target either of those to work.
Tested on `sparcv9-sun-solaris2.11`, `sparc64-unknown-linux-gnu`,
`amd64-pc-solaris2.11`, and `x86_64-pc-linux-gnu`.
---
flang/test/Driver/fveclib-codegen.f90 | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/flang/test/Driver/fveclib-codegen.f90 b/flang/test/Driver/fveclib-codegen.f90
index 8d7d3af1e8f9ba..2739e2d7cf1388 100644
--- a/flang/test/Driver/fveclib-codegen.f90
+++ b/flang/test/Driver/fveclib-codegen.f90
@@ -1,7 +1,8 @@
! test that -fveclib= is passed to the backend
! -target aarch64 so that ArmPL is available
-! RUN: %flang -S -Ofast -fveclib=LIBMVEC -o - %s | FileCheck %s
-! RUN: %flang -S -Ofast -fveclib=NoLibrary -o - %s | FileCheck %s --check-prefix=NOLIB
+! REQUIRES: x86-registered-target
+! RUN: %flang -S -Ofast -target x86_64-unknown-linux-gnu -fveclib=LIBMVEC -o - %s | FileCheck %s
+! RUN: %flang -S -Ofast -target x86_64-unknown-linux-gnu -fveclib=NoLibrary -o - %s | FileCheck %s --check-prefix=NOLIB
subroutine sb(a, b)
real :: a(:), b(:)
>From d2e4a7db0bdc9ffbd1533fd86bd8db8f55b994d8 Mon Sep 17 00:00:00 2001
From: Rainer Orth <ro at gcc.gnu.org>
Date: Wed, 14 Aug 2024 20:11:14 +0200
Subject: [PATCH 2/2] Run test on both aarch64 and x86_64.
---
flang/test/Driver/fveclib-codegen.f90 | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/flang/test/Driver/fveclib-codegen.f90 b/flang/test/Driver/fveclib-codegen.f90
index 2739e2d7cf1388..3a96c29ac70854 100644
--- a/flang/test/Driver/fveclib-codegen.f90
+++ b/flang/test/Driver/fveclib-codegen.f90
@@ -1,8 +1,8 @@
! test that -fveclib= is passed to the backend
! -target aarch64 so that ArmPL is available
-! REQUIRES: x86-registered-target
-! RUN: %flang -S -Ofast -target x86_64-unknown-linux-gnu -fveclib=LIBMVEC -o - %s | FileCheck %s
-! RUN: %flang -S -Ofast -target x86_64-unknown-linux-gnu -fveclib=NoLibrary -o - %s | FileCheck %s --check-prefix=NOLIB
+! RUN: %if aarch64-registered-target %{ %flang -S -Ofast -target aarch64-unknown-linux-gnu -fveclib=LIBMVEC -o - %s | FileCheck %s %}
+! RUN: %if x86-registered-target %{ %flang -S -Ofast -target x86_64-unknown-linux-gnu -fveclib=LIBMVEC -o - %s | FileCheck %s %}
+! RUN: %flang -S -Ofast -fveclib=NoLibrary -o - %s | FileCheck %s --check-prefix=NOLIB
subroutine sb(a, b)
real :: a(:), b(:)
More information about the flang-commits
mailing list