52 lines · plain
1! -----------------------------------------------------------------------------2! Tests for the -mrvv-vector-bits flag (taken from the clang test)3! -----------------------------------------------------------------------------4 5! RUN: %flang -c %s -### --target=riscv64-linux-gnu -march=rv64gc_zve64x \6! RUN: -mrvv-vector-bits=128 2>&1 | FileCheck --check-prefix=CHECK-128 %s7! RUN: %flang -c %s -### --target=riscv64-linux-gnu -march=rv64gc_zve64x \8! RUN: -mrvv-vector-bits=256 2>&1 | FileCheck --check-prefix=CHECK-256 %s9! RUN: %flang -c %s -### --target=riscv64-linux-gnu -march=rv64gc_zve64x \10! RUN: -mrvv-vector-bits=512 2>&1 | FileCheck --check-prefix=CHECK-512 %s11! RUN: %flang -c %s -### --target=riscv64-linux-gnu -march=rv64gc_zve64x \12! RUN: -mrvv-vector-bits=1024 2>&1 | FileCheck --check-prefix=CHECK-1024 %s13! RUN: %flang -c %s -### --target=riscv64-linux-gnu -march=rv64gc_zve64x \14! RUN: -mrvv-vector-bits=2048 2>&1 | FileCheck --check-prefix=CHECK-2048 %s15! RUN: %flang -c %s -### --target=riscv64-linux-gnu -march=rv64gc_zve64x \16! RUN: -mrvv-vector-bits=scalable 2>&1 | FileCheck --check-prefix=CHECK-SCALABLE %s17 18! RUN: %flang -c %s -### --target=riscv64-linux-gnu -march=rv64gcv_zvl256b \19! RUN: -mrvv-vector-bits=zvl 2>&1 | FileCheck --check-prefix=CHECK-256 %s20! RUN: %flang -c %s -### --target=riscv64-linux-gnu -march=rv64gcv_zvl512b \21! RUN: -mrvv-vector-bits=zvl 2>&1 | FileCheck --check-prefix=CHECK-512 %s22 23! CHECK-128: "-fc1"24! CHECK-128-SAME: "-mvscale-max=2" "-mvscale-min=2"25! CHECK-256: "-fc1"26! CHECK-256-SAME: "-mvscale-max=4" "-mvscale-min=4"27! CHECK-512: "-fc1"28! CHECK-512-SAME: "-mvscale-max=8" "-mvscale-min=8"29! CHECK-1024: "-fc1"30! CHECK-1024-SAME: "-mvscale-max=16" "-mvscale-min=16"31! CHECK-2048: "-fc1"32! CHECK-2048-SAME: "-mvscale-max=32" "-mvscale-min=32"33 34! CHECK-SCALABLE-NOT: "-mvscale-min=35! CHECK-SCALABLE-NOT: "-mvscale-max=36 37! Error out if an unsupported value is passed to -mrvv-vector-bits.38! -----------------------------------------------------------------------------39! RUN: not %flang -c %s -### --target=riscv64-linux-gnu -march=rv64gc_zve64x \40! RUN: -mrvv-vector-bits=16 2>&1 | FileCheck --check-prefix=CHECK-BAD-VALUE-ERROR %s41! RUN: not %flang -c %s -### --target=riscv64-linux-gnu -march=rv64gc_zve64x \42! RUN: -mrvv-vector-bits=A 2>&1 | FileCheck --check-prefix=CHECK-BAD-VALUE-ERROR %s43! RUN: not %flang -c %s -### --target=riscv64-linux-gnu -march=rv64gc_zve64x \44! RUN: -mrvv-vector-bits=131072 2>&1 | FileCheck --check-prefix=CHECK-BAD-VALUE-ERROR %s45! RUN: not %flang -c %s -### --target=riscv64-linux-gnu -march=rv64gc \46! RUN: -mrvv-vector-bits=zvl 2>&1 | FileCheck --check-prefix=CHECK-BAD-VALUE-ERROR %s47! RUN: not %flang -c %s -### --target=riscv64-linux-gnu -march=rv64gcv \48! RUN: -mrvv-vector-bits=64 2>&1 | FileCheck --check-prefix=CHECK-BAD-VALUE-ERROR %s49!50! CHECK-BAD-VALUE-ERROR: error: unsupported argument '{{.*}}' to option '-mrvv-vector-bits='51 52