|
7 | 7 | #include <arm_sve.h>
|
8 | 8 |
|
9 | 9 | #define N __ARM_FEATURE_SVE_BITS
|
10 |
| -#define FIXED_ATTR __attribute__((arm_sve_vector_bits(N))) |
| 10 | +#define SVE_FIXED_ATTR __attribute__((arm_sve_vector_bits(N))) |
| 11 | +#define GNU_FIXED_ATTR __attribute__((vector_size(N / 8))) |
11 | 12 |
|
12 |
| -typedef svfloat32_t fixed_float32_t FIXED_ATTR; |
13 |
| -typedef svint32_t fixed_int32_t FIXED_ATTR; |
| 13 | +typedef svfloat32_t sve_fixed_float32_t SVE_FIXED_ATTR; |
| 14 | +typedef svint32_t sve_fixed_int32_t SVE_FIXED_ATTR; |
| 15 | +typedef float gnu_fixed_float32_t GNU_FIXED_ATTR; |
| 16 | +typedef int gnu_fixed_int32_t GNU_FIXED_ATTR; |
14 | 17 |
|
15 |
| -void allowed_with_integer_lax_conversions() { |
16 |
| - fixed_int32_t fi32; |
| 18 | +void sve_allowed_with_integer_lax_conversions() { |
| 19 | + sve_fixed_int32_t fi32; |
17 | 20 | svint64_t si64;
|
18 | 21 |
|
19 | 22 | // The implicit cast here should fail if -flax-vector-conversions=none, but pass if
|
20 | 23 | // -flax-vector-conversions={integer,all}.
|
21 | 24 | fi32 = si64;
|
22 |
| - // lax-vector-none-error@-1 {{assigning to 'fixed_int32_t' (vector of 16 'int' values) from incompatible type}} |
| 25 | + // lax-vector-none-error@-1 {{assigning to 'sve_fixed_int32_t' (vector of 16 'int' values) from incompatible type}} |
23 | 26 | si64 = fi32;
|
24 | 27 | // lax-vector-none-error@-1 {{assigning to 'svint64_t' (aka '__SVInt64_t') from incompatible type}}
|
25 | 28 | }
|
26 | 29 |
|
27 |
| -void allowed_with_all_lax_conversions() { |
28 |
| - fixed_float32_t ff32; |
| 30 | +void sve_allowed_with_all_lax_conversions() { |
| 31 | + sve_fixed_float32_t ff32; |
29 | 32 | svfloat64_t sf64;
|
30 | 33 |
|
31 | 34 | // The implicit cast here should fail if -flax-vector-conversions={none,integer}, but pass if
|
32 | 35 | // -flax-vector-conversions=all.
|
33 | 36 | ff32 = sf64;
|
34 |
| - // lax-vector-none-error@-1 {{assigning to 'fixed_float32_t' (vector of 16 'float' values) from incompatible type}} |
35 |
| - // lax-vector-integer-error@-2 {{assigning to 'fixed_float32_t' (vector of 16 'float' values) from incompatible type}} |
| 37 | + // lax-vector-none-error@-1 {{assigning to 'sve_fixed_float32_t' (vector of 16 'float' values) from incompatible type}} |
| 38 | + // lax-vector-integer-error@-2 {{assigning to 'sve_fixed_float32_t' (vector of 16 'float' values) from incompatible type}} |
| 39 | + sf64 = ff32; |
| 40 | + // lax-vector-none-error@-1 {{assigning to 'svfloat64_t' (aka '__SVFloat64_t') from incompatible type}} |
| 41 | + // lax-vector-integer-error@-2 {{assigning to 'svfloat64_t' (aka '__SVFloat64_t') from incompatible type}} |
| 42 | +} |
| 43 | + |
| 44 | +void gnu_allowed_with_integer_lax_conversions() { |
| 45 | + gnu_fixed_int32_t fi32; |
| 46 | + svint64_t si64; |
| 47 | + |
| 48 | + // The implicit cast here should fail if -flax-vector-conversions=none, but pass if |
| 49 | + // -flax-vector-conversions={integer,all}. |
| 50 | + fi32 = si64; |
| 51 | + // lax-vector-none-error@-1 {{assigning to 'gnu_fixed_int32_t' (vector of 16 'int' values) from incompatible type}} |
| 52 | + si64 = fi32; |
| 53 | + // lax-vector-none-error@-1 {{assigning to 'svint64_t' (aka '__SVInt64_t') from incompatible type}} |
| 54 | +} |
| 55 | + |
| 56 | +void gnu_allowed_with_all_lax_conversions() { |
| 57 | + gnu_fixed_float32_t ff32; |
| 58 | + svfloat64_t sf64; |
| 59 | + |
| 60 | + // The implicit cast here should fail if -flax-vector-conversions={none,integer}, but pass if |
| 61 | + // -flax-vector-conversions=all. |
| 62 | + ff32 = sf64; |
| 63 | + // lax-vector-none-error@-1 {{assigning to 'gnu_fixed_float32_t' (vector of 16 'float' values) from incompatible type}} |
| 64 | + // lax-vector-integer-error@-2 {{assigning to 'gnu_fixed_float32_t' (vector of 16 'float' values) from incompatible type}} |
36 | 65 | sf64 = ff32;
|
37 | 66 | // lax-vector-none-error@-1 {{assigning to 'svfloat64_t' (aka '__SVFloat64_t') from incompatible type}}
|
38 | 67 | // lax-vector-integer-error@-2 {{assigning to 'svfloat64_t' (aka '__SVFloat64_t') from incompatible type}}
|
|
0 commit comments