brintos

brintos / llvm-project-archived public Read only

0
0
Text · 4.8 KiB · f54cd94 Raw
82 lines · c
1// -----------------------------------------------------------------------------2// Tests for the -msve-vector-bits flag3// -----------------------------------------------------------------------------4 5// RUN: %clang -c %s -### --target=aarch64-none-linux-gnu -march=armv8-a+sve \6// RUN:  -msve-vector-bits=128 2>&1 | FileCheck --check-prefix=CHECK-128 %s7// RUN: %clang -c %s -### --target=aarch64-none-linux-gnu -march=armv8-a+sve \8// RUN:  -msve-vector-bits=256 2>&1 | FileCheck --check-prefix=CHECK-256 %s9// RUN: %clang -c %s -### --target=aarch64-none-linux-gnu -march=armv8-a+sve \10// RUN:  -msve-vector-bits=512 2>&1 | FileCheck --check-prefix=CHECK-512 %s11// RUN: %clang -c %s -### --target=aarch64-none-linux-gnu -march=armv8-a+sve \12// RUN:  -msve-vector-bits=1024 2>&1 | FileCheck --check-prefix=CHECK-1024 %s13// RUN: %clang -c %s -### --target=aarch64-none-linux-gnu -march=armv8-a+sve \14// RUN:  -msve-vector-bits=2048 2>&1 | FileCheck --check-prefix=CHECK-2048 %s15// RUN: %clang -c %s -### --target=aarch64-none-linux-gnu -march=armv8-a+sve \16// RUN:  -msve-vector-bits=128+ 2>&1 | FileCheck --check-prefix=CHECK-128P %s17// RUN: %clang -c %s -### --target=aarch64-none-linux-gnu -march=armv8-a+sve \18// RUN:  -msve-vector-bits=256+ 2>&1 | FileCheck --check-prefix=CHECK-256P %s19// RUN: %clang -c %s -### --target=aarch64-none-linux-gnu -march=armv8-a+sve \20// RUN:  -msve-vector-bits=512+ 2>&1 | FileCheck --check-prefix=CHECK-512P %s21// RUN: %clang -c %s -### --target=aarch64-none-linux-gnu -march=armv8-a+sve \22// RUN:  -msve-vector-bits=1024+ 2>&1 | FileCheck --check-prefix=CHECK-1024P %s23// RUN: %clang -c %s -### --target=aarch64-none-linux-gnu -march=armv8-a+sve \24// RUN:  -msve-vector-bits=2048+ 2>&1 | FileCheck --check-prefix=CHECK-2048P %s25// RUN: %clang -c %s -### --target=aarch64-none-linux-gnu -march=armv8-a+sve \26// RUN:  -msve-vector-bits=scalable 2>&1 | FileCheck --check-prefix=CHECK-SCALABLE %s27// RUN: %clang -c %s -### --target=aarch64-none-linux-gnu -march=armv8-a+sve+sme \28// RUN:  -msve-streaming-vector-bits=128 2>&1 | FileCheck --check-prefix=STREAMING-128 %s29 30// CHECK-128: "-mvscale-max=1" "-mvscale-min=1"31// CHECK-256: "-mvscale-max=2" "-mvscale-min=2"32// CHECK-512: "-mvscale-max=4" "-mvscale-min=4"33// CHECK-1024: "-mvscale-max=8" "-mvscale-min=8"34// CHECK-2048: "-mvscale-max=16" "-mvscale-min=16"35 36// CHECK-128P: "-mvscale-min=1"37// CHECK-128P-NOT: "-mvscale-max"38// CHECK-256P: "-mvscale-min=2"39// CHECK-256P-NOT: "-mvscale-max"40// CHECK-512P: "-mvscale-min=4"41// CHECK-512P-NOT: "-mvscale-max"42// CHECK-1024P: "-mvscale-min=8"43// CHECK-1024P-NOT: "-mvscale-max"44// CHECK-2048P: "-mvscale-min=16"45// CHECK-2048P-NOT: "-mvscale-max"46// CHECK-SCALABLE-NOT: "-mvscale-min=47// CHECK-SCALABLE-NOT: "-mvscale-max=48 49// STREAMING-128: "-mvscale-streaming-max=1" "-mvscale-streaming-min=1"50 51// Error out if an unsupported value is passed to -msve-vector-bits.52// -----------------------------------------------------------------------------53// RUN: not %clang -c %s -### --target=aarch64-none-linux-gnu -march=armv8-a+sve \54// RUN:  -msve-vector-bits=64 2>&1 | FileCheck --check-prefix=CHECK-BAD-VALUE-ERROR %s55// RUN: not %clang -c %s -### --target=aarch64-none-linux-gnu -march=armv8-a+sve \56// RUN:  -msve-vector-bits=A 2>&1 | FileCheck --check-prefix=CHECK-BAD-VALUE-ERROR %s57 58// CHECK-BAD-VALUE-ERROR: error: unsupported argument '{{.*}}' to option '-msve-vector-bits='59 60// Error if using attribute without -msve-vector-bits=<bits> or if using -msve-vector-bits=<bits>+ syntax61// -----------------------------------------------------------------------------62// RUN: not %clang -c %s -o /dev/null --target=aarch64-none-linux-gnu \63// RUN:  -march=armv8-a+sve 2>&1 | FileCheck --check-prefix=CHECK-NO-FLAG-ERROR %s64// RUN: not %clang -c %s -o /dev/null --target=aarch64-none-linux-gnu \65// RUN:  -march=armv8-a+sve -msve-vector-bits=scalable 2>&1 | FileCheck --check-prefix=CHECK-NO-FLAG-ERROR %s66// RUN: not %clang -c %s -o /dev/null --target=aarch64-none-linux-gnu \67// RUN:  -march=armv8-a+sve -msve-vector-bits=256+ 2>&1 | FileCheck --check-prefix=CHECK-NO-FLAG-ERROR %s68 69typedef __SVInt32_t svint32_t;70typedef svint32_t noflag __attribute__((arm_sve_vector_bits(256)));71 72// CHECK-NO-FLAG-ERROR: error: 'arm_sve_vector_bits' is only supported when '-msve-vector-bits=<bits>' is specified with a value of 128, 256, 512, 1024 or 204873 74// Error if attribute vector size != -msve-vector-bits75// -----------------------------------------------------------------------------76// RUN: not %clang -c %s -o /dev/null --target=aarch64-none-linux-gnu \77// RUN:  -march=armv8-a+sve -msve-vector-bits=128 2>&1 | FileCheck --check-prefix=CHECK-BAD-VECTOR-SIZE-ERROR %s78 79typedef svint32_t bad_vector_size __attribute__((arm_sve_vector_bits(256)));80 81// CHECK-BAD-VECTOR-SIZE-ERROR: error: invalid SVE vector size '256', must match value set by '-msve-vector-bits' ('128')82