1 // ----------------------------------------------------------------------------- 2 // Tests for the -msve-vector-bits flag 3 // ----------------------------------------------------------------------------- 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 %s 7 // 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 %s 9 // 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 %s 11 // 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 %s 13 // 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 %s 15 // RUN: %clang -c %s -### -target aarch64-none-linux-gnu -march=armv8-a+sve \ 16 // RUN: -msve-vector-bits=scalable 2>&1 | FileCheck --check-prefix=CHECK-SCALABLE %s 17 18 // CHECK-128: "-msve-vector-bits=128" 19 // CHECK-256: "-msve-vector-bits=256" 20 // CHECK-512: "-msve-vector-bits=512" 21 // CHECK-1024: "-msve-vector-bits=1024" 22 // CHECK-2048: "-msve-vector-bits=2048" 23 // CHECK-SCALABLE-NOT: "-msve-vector-bits= 24 25 // Bail out if -msve-vector-bits is specified without SVE enabled 26 // ----------------------------------------------------------------------------- 27 // RUN: %clang -c %s -### -target aarch64-none-linux-gnu -msve-vector-bits=128 \ 28 // RUN: 2>&1 | FileCheck --check-prefix=CHECK-NO-SVE-ERROR %s 29 // RUN: %clang -c %s -### -target aarch64-none-linux-gnu -msve-vector-bits=256 \ 30 // RUN: 2>&1 | FileCheck --check-prefix=CHECK-NO-SVE-ERROR %s 31 // RUN: %clang -c %s -### -target aarch64-none-linux-gnu -msve-vector-bits=512 \ 32 // RUN: 2>&1 | FileCheck --check-prefix=CHECK-NO-SVE-ERROR %s 33 // RUN: %clang -c %s -### -target aarch64-none-linux-gnu -msve-vector-bits=1024 \ 34 // RUN: 2>&1 | FileCheck --check-prefix=CHECK-NO-SVE-ERROR %s 35 // RUN: %clang -c %s -### -target aarch64-none-linux-gnu -msve-vector-bits=2048 \ 36 // RUN: 2>&1 | FileCheck --check-prefix=CHECK-NO-SVE-ERROR %s 37 38 // CHECK-NO-SVE-ERROR: error: '-msve-vector-bits' is not supported without SVE enabled 39 40 // Error out if an unsupported value is passed to -msve-vector-bits. 41 // ----------------------------------------------------------------------------- 42 // RUN: %clang -c %s -### -target aarch64-none-linux-gnu -march=armv8-a+sve \ 43 // RUN: -msve-vector-bits=64 2>&1 | FileCheck --check-prefix=CHECK-BAD-VALUE-ERROR %s 44 // RUN: %clang -c %s -### -target aarch64-none-linux-gnu -march=armv8-a+sve \ 45 // RUN: -msve-vector-bits=A 2>&1 | FileCheck --check-prefix=CHECK-BAD-VALUE-ERROR %s 46 47 // CHECK-BAD-VALUE-ERROR: error: unsupported argument '{{.*}}' to option 'msve-vector-bits=' 48 49 // Error if using attribute without -msve-vector-bits 50 // ----------------------------------------------------------------------------- 51 // RUN: not %clang -c %s -o /dev/null -target aarch64-none-linux-gnu \ 52 // RUN: -march=armv8-a+sve 2>&1 | FileCheck --check-prefix=CHECK-NO-FLAG-ERROR %s 53 // RUN: not %clang -c %s -o /dev/null -target aarch64-none-linux-gnu \ 54 // RUN: -march=armv8-a+sve -msve-vector-bits=scalable 2>&1 | FileCheck --check-prefix=CHECK-NO-FLAG-ERROR %s 55 56 typedef __SVInt32_t svint32_t; 57 typedef svint32_t noflag __attribute__((arm_sve_vector_bits(256))); 58 59 // 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 2048 60 61 // Error if attribute vector size != -msve-vector-bits 62 // ----------------------------------------------------------------------------- 63 // RUN: not %clang -c %s -o /dev/null -target aarch64-none-linux-gnu \ 64 // RUN: -march=armv8-a+sve -msve-vector-bits=128 2>&1 | FileCheck --check-prefix=CHECK-BAD-VECTOR-SIZE-ERROR %s 65 66 typedef svint32_t bad_vector_size __attribute__((arm_sve_vector_bits(256))); 67 68 // CHECK-BAD-VECTOR-SIZE-ERROR: error: invalid SVE vector size '256', must match value set by '-msve-vector-bits' ('128') 69