[flang-commits] [flang] [flang]Add vscale argument parsing (PR #67676)

Mats Petersson via flang-commits flang-commits at lists.llvm.org
Fri Sep 29 09:19:21 PDT 2023


================
@@ -0,0 +1,55 @@
+! -----------------------------------------------------------------------------
+! Tests for the -msve-vector-bits flag (taken from the clang test)
+! -----------------------------------------------------------------------------
+
+! RUN: %flang -c %s -### --target=aarch64-none-linux-gnu -march=armv8-a+sve \
+! RUN:  -msve-vector-bits=128 2>&1 | FileCheck --check-prefix=CHECK-128 %s
+! RUN: %flang -c %s -### --target=aarch64-none-linux-gnu -march=armv8-a+sve \
+! RUN:  -msve-vector-bits=256 2>&1 | FileCheck --check-prefix=CHECK-256 %s
+! RUN: %flang -c %s -### --target=aarch64-none-linux-gnu -march=armv8-a+sve \
+! RUN:  -msve-vector-bits=512 2>&1 | FileCheck --check-prefix=CHECK-512 %s
+! RUN: %flang -c %s -### --target=aarch64-none-linux-gnu -march=armv8-a+sve \
+! RUN:  -msve-vector-bits=1024 2>&1 | FileCheck --check-prefix=CHECK-1024 %s
+! RUN: %flang -c %s -### --target=aarch64-none-linux-gnu -march=armv8-a+sve \
+! RUN:  -msve-vector-bits=2048 2>&1 | FileCheck --check-prefix=CHECK-2048 %s
+! RUN: %flang -c %s -### --target=aarch64-none-linux-gnu -march=armv8-a+sve \
+! RUN:  -msve-vector-bits=128+ 2>&1 | FileCheck --check-prefix=CHECK-128P %s
+! RUN: %flang -c %s -### --target=aarch64-none-linux-gnu -march=armv8-a+sve \
+! RUN:  -msve-vector-bits=256+ 2>&1 | FileCheck --check-prefix=CHECK-256P %s
+! RUN: %flang -c %s -### --target=aarch64-none-linux-gnu -march=armv8-a+sve \
+! RUN:  -msve-vector-bits=512+ 2>&1 | FileCheck --check-prefix=CHECK-512P %s
+! RUN: %flang -c %s -### --target=aarch64-none-linux-gnu -march=armv8-a+sve \
+! RUN:  -msve-vector-bits=1024+ 2>&1 | FileCheck --check-prefix=CHECK-1024P %s
+! RUN: %flang -c %s -### --target=aarch64-none-linux-gnu -march=armv8-a+sve \
+! RUN:  -msve-vector-bits=2048+ 2>&1 | FileCheck --check-prefix=CHECK-2048P %s
+! RUN: %flang -c %s -### --target=aarch64-none-linux-gnu -march=armv8-a+sve \
+! RUN:  -msve-vector-bits=scalable 2>&1 | FileCheck --check-prefix=CHECK-SCALABLE %s
+
+! CHECK-128: "-mvscale-max=1" "-mvscale-min=1"
----------------
Leporacanthicus wrote:

It's like that in the original clang/test/Driver/aarch64-sve-vector-bits.c - I just changed it to using a flang instead of clang (and removed a bit of testing for attributes for vector range - Fotran doesn't have function attributes, as far as I'm aware)

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


More information about the flang-commits mailing list