|
| 1 | +! ----------------------------------------------------------------------------- |
| 2 | +! Tests for the -msve-vector-bits flag (taken from the clang test) |
| 3 | +! ----------------------------------------------------------------------------- |
| 4 | + |
| 5 | +! RUN: %flang -c %s -### --target=aarch64-none-linux-gnu -march=armv8-a+sve \ |
| 6 | +! RUN: -msve-vector-bits=128 2>&1 | FileCheck --check-prefix=CHECK-128 %s |
| 7 | +! RUN: %flang -c %s -### --target=aarch64-none-linux-gnu -march=armv8-a+sve \ |
| 8 | +! RUN: -msve-vector-bits=256 2>&1 | FileCheck --check-prefix=CHECK-256 %s |
| 9 | +! RUN: %flang -c %s -### --target=aarch64-none-linux-gnu -march=armv8-a+sve \ |
| 10 | +! RUN: -msve-vector-bits=512 2>&1 | FileCheck --check-prefix=CHECK-512 %s |
| 11 | +! RUN: %flang -c %s -### --target=aarch64-none-linux-gnu -march=armv8-a+sve \ |
| 12 | +! RUN: -msve-vector-bits=1024 2>&1 | FileCheck --check-prefix=CHECK-1024 %s |
| 13 | +! RUN: %flang -c %s -### --target=aarch64-none-linux-gnu -march=armv8-a+sve \ |
| 14 | +! RUN: -msve-vector-bits=2048 2>&1 | FileCheck --check-prefix=CHECK-2048 %s |
| 15 | +! RUN: %flang -c %s -### --target=aarch64-none-linux-gnu -march=armv8-a+sve \ |
| 16 | +! RUN: -msve-vector-bits=128+ 2>&1 | FileCheck --check-prefix=CHECK-128P %s |
| 17 | +! RUN: %flang -c %s -### --target=aarch64-none-linux-gnu -march=armv8-a+sve \ |
| 18 | +! RUN: -msve-vector-bits=256+ 2>&1 | FileCheck --check-prefix=CHECK-256P %s |
| 19 | +! RUN: %flang -c %s -### --target=aarch64-none-linux-gnu -march=armv8-a+sve \ |
| 20 | +! RUN: -msve-vector-bits=512+ 2>&1 | FileCheck --check-prefix=CHECK-512P %s |
| 21 | +! RUN: %flang -c %s -### --target=aarch64-none-linux-gnu -march=armv8-a+sve \ |
| 22 | +! RUN: -msve-vector-bits=1024+ 2>&1 | FileCheck --check-prefix=CHECK-1024P %s |
| 23 | +! RUN: %flang -c %s -### --target=aarch64-none-linux-gnu -march=armv8-a+sve \ |
| 24 | +! RUN: -msve-vector-bits=2048+ 2>&1 | FileCheck --check-prefix=CHECK-2048P %s |
| 25 | +! RUN: %flang -c %s -### --target=aarch64-none-linux-gnu -march=armv8-a+sve \ |
| 26 | +! RUN: -msve-vector-bits=scalable 2>&1 | FileCheck --check-prefix=CHECK-SCALABLE %s |
| 27 | + |
| 28 | +! CHECK-128: "-mvscale-max=1" "-mvscale-min=1" |
| 29 | +! CHECK-256: "-mvscale-max=2" "-mvscale-min=2" |
| 30 | +! CHECK-512: "-mvscale-max=4" "-mvscale-min=4" |
| 31 | +! CHECK-1024: "-mvscale-max=8" "-mvscale-min=8" |
| 32 | +! CHECK-2048: "-mvscale-max=16" "-mvscale-min=16" |
| 33 | + |
| 34 | +! CHECK-128P: "-mvscale-min=1" |
| 35 | +! CHECK-128P-NOT: "-mvscale-max" |
| 36 | +! CHECK-256P: "-mvscale-min=2" |
| 37 | +! CHECK-256P-NOT: "-mvscale-max" |
| 38 | +! CHECK-512P: "-mvscale-min=4" |
| 39 | +! CHECK-512P-NOT: "-mvscale-max" |
| 40 | +! CHECK-1024P: "-mvscale-min=8" |
| 41 | +! CHECK-1024P-NOT: "-mvscale-max" |
| 42 | +! CHECK-2048P: "-mvscale-min=16" |
| 43 | +! CHECK-2048P-NOT: "-mvscale-max" |
| 44 | +! CHECK-SCALABLE-NOT: "-mvscale-min= |
| 45 | +! CHECK-SCALABLE-NOT: "-mvscale-max= |
| 46 | + |
| 47 | +! Error out if an unsupported value is passed to -msve-vector-bits. |
| 48 | +! ----------------------------------------------------------------------------- |
| 49 | +! RUN: not %flang -c %s -### --target=aarch64-none-linux-gnu -march=armv8-a+sve \ |
| 50 | +! RUN: -msve-vector-bits=64 2>&1 | FileCheck --check-prefix=CHECK-BAD-VALUE-ERROR %s |
| 51 | +! RUN: not %flang -c %s -### --target=aarch64-none-linux-gnu -march=armv8-a+sve \ |
| 52 | +! RUN: -msve-vector-bits=A 2>&1 | FileCheck --check-prefix=CHECK-BAD-VALUE-ERROR %s |
| 53 | + |
| 54 | +! CHECK-BAD-VALUE-ERROR: error: unsupported argument '{{.*}}' to option '-msve-vector-bits=' |
| 55 | + |
0 commit comments