| 1 |
/* { dg-options "-msve-vector-bits=256 -W -Wall" } */ |
| 2 |
|
| 3 |
#include <arm_sve.h> |
| 4 |
|
| 5 |
#define N __ARM_FEATURE_SVE_BITS |
| 6 |
#define FIXED_ATTR __attribute__ ((arm_sve_vector_bits (N))) |
| 7 |
|
| 8 |
template<typename T> struct foo { T var; }; |
| 9 |
|
| 10 |
typedef svint8_t var1; |
| 11 |
typedef __SVInt8_t var2; |
| 12 |
|
| 13 |
typedef const var1 const_var1; |
| 14 |
typedef const var2 const_var2; |
| 15 |
|
| 16 |
typedef svint8_t fixed1 FIXED_ATTR; |
| 17 |
typedef svint8_t fixed1_alias FIXED_ATTR; |
| 18 |
typedef __SVInt8_t fixed2 FIXED_ATTR; |
| 19 |
|
| 20 |
typedef const_var1 const_fixed1 FIXED_ATTR; |
| 21 |
typedef const var1 const_fixed1_alias FIXED_ATTR; |
| 22 |
typedef const_var2 const_fixed2 FIXED_ATTR; |
| 23 |
|
| 24 |
extern fixed1 extern1; |
| 25 |
extern fixed1_alias extern1_alias; |
| 26 |
extern fixed2 extern2; |
| 27 |
|
| 28 |
extern foo<fixed1> extern1_foo; |
| 29 |
extern foo<fixed1_alias> extern1_alias_foo; |
| 30 |
extern foo<fixed2> extern2_foo; |
| 31 |
|
| 32 |
extern const_fixed1 const_extern1; |
| 33 |
extern const_fixed1_alias const_extern1_alias; |
| 34 |
extern const_fixed2 const_extern2; |
| 35 |
|
| 36 |
extern foo<const_fixed1> const_extern1_foo; |
| 37 |
extern foo<const_fixed1_alias> const_extern1_alias_foo; |
| 38 |
extern foo<const_fixed2> const_extern2_foo; |
| 39 |
|
| 40 |
fixed1 &ref1a = extern1; |
| 41 |
fixed1_alias &ref1b = extern1; |
| 42 |
fixed2 &ref1c = extern1; |
| 43 |
|
| 44 |
fixed1 &ref2a = extern1_alias; |
| 45 |
fixed1_alias &ref2b = extern1_alias; |
| 46 |
fixed2 &ref2c = extern1_alias; |
| 47 |
|
| 48 |
fixed1 &ref3a = extern2; |
| 49 |
fixed1_alias &ref3b = extern2; |
| 50 |
fixed2 &ref3c = extern2; |
| 51 |
|
| 52 |
fixed1 &ref1a_foo = extern1_foo.var; |
| 53 |
fixed1_alias &ref1b_foo = extern1_foo.var; |
| 54 |
fixed2 &ref1c_foo = extern1_foo.var; |
| 55 |
|
| 56 |
fixed1 &ref2a_foo = extern1_alias_foo.var; |
| 57 |
fixed1_alias &ref2b_foo = extern1_alias_foo.var; |
| 58 |
fixed2 &ref2c_foo = extern1_alias_foo.var; |
| 59 |
|
| 60 |
fixed1 &ref3a_foo = extern2_foo.var; |
| 61 |
fixed1_alias &ref3b_foo = extern2_foo.var; |
| 62 |
fixed2 &ref3c_foo = extern2_foo.var; |
| 63 |
|
| 64 |
fixed1 &ref4a = const_extern1; // { dg-error {discards qualifiers} } |
| 65 |
fixed1_alias &ref4b = const_extern1; // { dg-error {discards qualifiers} } |
| 66 |
fixed2 &ref4c = const_extern1; // { dg-error {discards qualifiers} } |
| 67 |
|
| 68 |
fixed1 &ref4a_foo = const_extern1_foo.var; // { dg-error {discards qualifiers} } |
| 69 |
fixed1_alias &ref4b_foo = const_extern1_foo.var; // { dg-error {discards qualifiers} } |
| 70 |
fixed2 &ref4c_foo = const_extern1_foo.var; // { dg-error {discards qualifiers} } |
| 71 |
|
| 72 |
const fixed1 &ref5a = const_extern2; |
| 73 |
const fixed1_alias &ref5b = const_extern2; |
| 74 |
const fixed2 &ref5c = const_extern2; |
| 75 |
|
| 76 |
const_fixed1 &const_ref1a = extern1; |
| 77 |
const_fixed1_alias &const_ref1b = extern1; |
| 78 |
const_fixed2 &const_ref1c = extern1; |
| 79 |
|
| 80 |
const_fixed1 &const_ref2a = extern1_alias; |
| 81 |
const_fixed1_alias &const_ref2b = extern1_alias; |
| 82 |
const_fixed2 &const_ref2c = extern1_alias; |
| 83 |
|
| 84 |
const_fixed1 &const_ref3a = extern2; |
| 85 |
const_fixed1_alias &const_ref3b = extern2; |
| 86 |
const_fixed2 &const_ref3c = extern2; |
| 87 |
|
| 88 |
const_fixed1 &const_ref1a_foo = extern1_foo.var; |
| 89 |
const_fixed1_alias &const_ref1b_foo = extern1_foo.var; |
| 90 |
const_fixed2 &const_ref1c_foo = extern1_foo.var; |
| 91 |
|
| 92 |
const_fixed1 &const_ref2a_foo = extern1_alias_foo.var; |
| 93 |
const_fixed1_alias &const_ref2b_foo = extern1_alias_foo.var; |
| 94 |
const_fixed2 &const_ref2c_foo = extern1_alias_foo.var; |
| 95 |
|
| 96 |
const_fixed1 &const_ref3a_foo = extern2_foo.var; |
| 97 |
const_fixed1_alias &const_ref3b_foo = extern2_foo.var; |
| 98 |
const_fixed2 &const_ref3c_foo = extern2_foo.var; |
| 99 |
|
| 100 |
const_fixed1 &const_ref4a = const_extern1; |
| 101 |
const_fixed1_alias &const_ref4b = const_extern1; |
| 102 |
const_fixed2 &const_ref4c = const_extern1; |
| 103 |
|
| 104 |
const_fixed1 &const_ref5a = const_extern1_alias; |
| 105 |
const_fixed1_alias &const_ref5b = const_extern1_alias; |
| 106 |
const_fixed2 &const_ref5c = const_extern1_alias; |
| 107 |
|
| 108 |
const_fixed1 &const_ref6a = const_extern2; |
| 109 |
const_fixed1_alias &const_ref6b = const_extern2; |
| 110 |
const_fixed2 &const_ref6c = const_extern2; |
| 111 |
|
| 112 |
const_fixed1 &const_ref4a_foo = const_extern1_foo.var; |
| 113 |
const_fixed1_alias &const_ref4b_foo = const_extern1_foo.var; |
| 114 |
const_fixed2 &const_ref4c_foo = const_extern1_foo.var; |
| 115 |
|
| 116 |
const_fixed1 &const_ref5a_foo = const_extern1_alias_foo.var; |
| 117 |
const_fixed1_alias &const_ref5b_foo = const_extern1_alias_foo.var; |
| 118 |
const_fixed2 &const_ref5c_foo = const_extern1_alias_foo.var; |
| 119 |
|
| 120 |
const_fixed1 &const_ref6a_foo = const_extern2_foo.var; |
| 121 |
const_fixed1_alias &const_ref6b_foo = const_extern2_foo.var; |
| 122 |
const_fixed2 &const_ref6c_foo = const_extern2_foo.var; |