| 1 |
#include "diag-aka-5.h" |
| 2 |
|
| 3 |
typedef user_enum user_enum_copy; |
| 4 |
|
| 5 |
struct s { int i; }; |
| 6 |
|
| 7 |
user_enum ue1; |
| 8 |
user_enum_copy ue2; |
| 9 |
user_enum_ptr ue_ptr1; |
| 10 |
user_enum *ue_ptr2; |
| 11 |
const user_enum *const_ue_ptr1; |
| 12 |
const user_enum_copy *const_ue_ptr2; |
| 13 |
volatile user_enum *volatile_ue_ptr1; |
| 14 |
volatile user_enum_copy *volatile_ue_ptr2; |
| 15 |
__extension__ _Atomic user_enum *atomic_ue_ptr1; |
| 16 |
__extension__ _Atomic user_enum_copy *atomic_ue_ptr2; |
| 17 |
user_enum (*ue_array_ptr1)[10]; |
| 18 |
user_enum_copy (*ue_array_ptr2)[10]; |
| 19 |
user_enum (*ue_fn_ptr1) (void); |
| 20 |
void (*ue_fn_ptr2) (user_enum); |
| 21 |
void (*ue_fn_ptr3) (user_enum, ...); |
| 22 |
user_enum_copy (*ue_fn_ptr4) (void); |
| 23 |
void (*ue_fn_ptr5) (user_enum_copy); |
| 24 |
void (*ue_fn_ptr6) (user_enum_copy, ...); |
| 25 |
user_enum (*__attribute__((__transaction_unsafe__)) unsafe_ue_fn_ptr1) (void); |
| 26 |
user_enum_copy (*__attribute__((__transaction_unsafe__)) unsafe_ue_fn_ptr2) (void); |
| 27 |
|
| 28 |
user_struct us1; |
| 29 |
user_struct_copy us2; |
| 30 |
user_struct_ptr us_ptr1; |
| 31 |
user_struct *us_ptr2; |
| 32 |
const user_struct *const_us_ptr1; |
| 33 |
const user_struct_copy *const_us_ptr2; |
| 34 |
|
| 35 |
user_union uu1; |
| 36 |
user_union_copy uu2; |
| 37 |
user_union_ptr uu_ptr1; |
| 38 |
user_union *uu_ptr2; |
| 39 |
const user_union *const_uu_ptr1; |
| 40 |
const user_union_copy *const_uu_ptr2; |
| 41 |
|
| 42 |
user_vector uv1; |
| 43 |
user_vector_copy uv2; |
| 44 |
user_vector_ptr uv_ptr1; |
| 45 |
user_vector *uv_ptr2; |
| 46 |
const user_vector *const_uv_ptr1; |
| 47 |
const user_vector_copy *const_uv_ptr2; |
| 48 |
|
| 49 |
user_int ui1; |
| 50 |
user_int_copy ui2; |
| 51 |
user_int_ptr ui_ptr1; |
| 52 |
user_int *ui_ptr2; |
| 53 |
const user_int *const_ui_ptr1; |
| 54 |
const user_int_copy *const_ui_ptr2; |
| 55 |
volatile user_int *volatile_ui_ptr1; |
| 56 |
volatile user_int_copy *volatile_ui_ptr2; |
| 57 |
__extension__ _Atomic user_int *atomic_ui_ptr1; |
| 58 |
__extension__ _Atomic user_int_copy *atomic_ui_ptr2; |
| 59 |
user_int (*ui_array_ptr1)[10]; |
| 60 |
user_int_copy (*ui_array_ptr2)[10]; |
| 61 |
user_int (*ui_fn_ptr1) (void); |
| 62 |
void (*ui_fn_ptr2) (user_int); |
| 63 |
void (*ui_fn_ptr3) (user_int, ...); |
| 64 |
user_int_copy (*ui_fn_ptr4) (void); |
| 65 |
void (*ui_fn_ptr5) (user_int_copy); |
| 66 |
void (*ui_fn_ptr6) (user_int_copy, ...); |
| 67 |
user_int (*__attribute__((__transaction_unsafe__)) unsafe_ui_fn_ptr1) (void); |
| 68 |
user_int_copy (*__attribute__((__transaction_unsafe__)) unsafe_ui_fn_ptr2) (void); |
| 69 |
|
| 70 |
void f (struct s s) |
| 71 |
{ |
| 72 |
ue1 = s; /* { dg-error {assigning to type 'user_enum' {aka 'enum __internal_enum'} from type 'struct s'} } */ |
| 73 |
ue2 = s; /* { dg-error {assigning to type 'user_enum_copy' {aka 'enum __internal_enum'} from type 'struct s'} } */ |
| 74 |
ue_ptr1 = &s; /* { dg-error {assignment to 'user_enum_ptr' {aka 'enum __internal_enum \*'} from incompatible pointer type 'struct s \*'} } */ |
| 75 |
ue_ptr2 = &s; /* { dg-error {assignment to 'user_enum \*' {aka 'enum __internal_enum \*'} from incompatible pointer type 'struct s \*'} } */ |
| 76 |
const_ue_ptr1 = &s; /* { dg-error {assignment to 'const user_enum \*' {aka 'const enum __internal_enum \*'} from incompatible pointer type 'struct s \*'} } */ |
| 77 |
const_ue_ptr2 = &s; /* { dg-error {assignment to 'const user_enum_copy \*' {aka 'const enum __internal_enum \*'} from incompatible pointer type 'struct s \*'} } */ |
| 78 |
volatile_ue_ptr1 = &s; /* { dg-error {assignment to 'volatile user_enum \*' {aka 'volatile enum __internal_enum \*'} from incompatible pointer type 'struct s \*'} } */ |
| 79 |
volatile_ue_ptr2 = &s; /* { dg-error {assignment to 'volatile user_enum_copy \*' {aka 'volatile enum __internal_enum \*'} from incompatible pointer type 'struct s \*'} } */ |
| 80 |
atomic_ue_ptr1 = &s; /* { dg-error {assignment to '_Atomic user_enum \*' {aka '_Atomic enum __internal_enum \*'} from incompatible pointer type 'struct s \*'} } */ |
| 81 |
atomic_ue_ptr2 = &s; /* { dg-error {assignment to '_Atomic user_enum_copy \*' {aka '_Atomic enum __internal_enum \*'} from incompatible pointer type 'struct s \*'} } */ |
| 82 |
ue_array_ptr1 = &s; /* { dg-error {assignment to 'user_enum \(\*\)\[10\]' {aka 'enum __internal_enum \(\*\)\[10\]'} from incompatible pointer type 'struct s \*'} } */ |
| 83 |
ue_array_ptr2 = &s; /* { dg-error {assignment to 'user_enum_copy \(\*\)\[10\]' {aka 'enum __internal_enum \(\*\)\[10\]'} from incompatible pointer type 'struct s \*'} } */ |
| 84 |
ue_fn_ptr1 = &s; /* { dg-error {assignment to 'user_enum \(\*\)\(void\)' {aka 'enum __internal_enum \(\*\)\(void\)'} from incompatible pointer type 'struct s \*'} } */ |
| 85 |
ue_fn_ptr2 = &s; /* { dg-error {assignment to 'void \(\*\)\(user_enum\)' {aka 'void \(\*\)\(enum __internal_enum\)'} from incompatible pointer type 'struct s \*'} } */ |
| 86 |
ue_fn_ptr3 = &s; /* { dg-error {assignment to 'void \(\*\)\(user_enum, \.\.\.\)' {aka 'void \(\*\)\(enum __internal_enum, \.\.\.\)'} from incompatible pointer type 'struct s \*'} } */ |
| 87 |
ue_fn_ptr4 = &s; /* { dg-error {assignment to 'user_enum_copy \(\*\)\(void\)' {aka 'enum __internal_enum \(\*\)\(void\)'} from incompatible pointer type 'struct s \*'} } */ |
| 88 |
ue_fn_ptr5 = &s; /* { dg-error {assignment to 'void \(\*\)\(user_enum_copy\)' {aka 'void \(\*\)\(enum __internal_enum\)'} from incompatible pointer type 'struct s \*'} } */ |
| 89 |
ue_fn_ptr6 = &s; /* { dg-error {assignment to 'void \(\*\)\(user_enum_copy, \.\.\.\)' {aka 'void \(\*\)\(enum __internal_enum, \.\.\.\)'} from incompatible pointer type 'struct s \*'} } */ |
| 90 |
unsafe_ue_fn_ptr1 = &s; /* { dg-error {assignment to 'user_enum \(__attribute__\(\(transaction_unsafe\)\) \*\)\(void\)' {aka 'enum __internal_enum \(__attribute__\(\(transaction_unsafe\)\) \*\)\(void\)'} from incompatible pointer type 'struct s \*'} } */ |
| 91 |
unsafe_ue_fn_ptr2 = &s; /* { dg-error {assignment to 'user_enum_copy \(__attribute__\(\(transaction_unsafe\)\) \*\)\(void\)' {aka 'enum __internal_enum \(__attribute__\(\(transaction_unsafe\)\) \*\)\(void\)'} from incompatible pointer type 'struct s \*'} } */ |
| 92 |
|
| 93 |
us1 = s; /* { dg-error {assigning to type 'user_struct' {aka 'struct __internal_struct'} from type 'struct s'} } */ |
| 94 |
us2 = s; /* { dg-error {assigning to type 'user_struct_copy' {aka 'struct __internal_struct'} from type 'struct s'} } */ |
| 95 |
us_ptr1 = &s; /* { dg-error {assignment to 'user_struct_ptr' {aka 'struct __internal_struct \*'} from incompatible pointer type 'struct s \*'} } */ |
| 96 |
us_ptr2 = &s; /* { dg-error {assignment to 'user_struct \*' {aka 'struct __internal_struct \*'} from incompatible pointer type 'struct s \*'} } */ |
| 97 |
const_us_ptr1 = &s; /* { dg-error {assignment to 'const user_struct \*' {aka 'const struct __internal_struct \*'} from incompatible pointer type 'struct s \*'} } */ |
| 98 |
const_us_ptr2 = &s; /* { dg-error {assignment to 'const user_struct_copy \*' {aka 'const struct __internal_struct \*'} from incompatible pointer type 'struct s \*'} } */ |
| 99 |
|
| 100 |
uu1 = s; /* { dg-error {assigning to type 'user_union' {aka 'union __internal_union'} from type 'struct s'} } */ |
| 101 |
uu2 = s; /* { dg-error {assigning to type 'user_union_copy' {aka 'union __internal_union'} from type 'struct s'} } */ |
| 102 |
uu_ptr1 = &s; /* { dg-error {assignment to 'user_union_ptr' {aka 'union __internal_union \*'} from incompatible pointer type 'struct s \*'} } */ |
| 103 |
uu_ptr2 = &s; /* { dg-error {assignment to 'user_union \*' {aka 'union __internal_union \*'} from incompatible pointer type 'struct s \*'} } */ |
| 104 |
const_uu_ptr1 = &s; /* { dg-error {assignment to 'const user_union \*' {aka 'const union __internal_union \*'} from incompatible pointer type 'struct s \*'} } */ |
| 105 |
const_uu_ptr2 = &s; /* { dg-error {assignment to 'const user_union_copy \*' {aka 'const union __internal_union \*'} from incompatible pointer type 'struct s \*'} } */ |
| 106 |
|
| 107 |
uv1 = s; /* { dg-error {assigning to type 'user_vector' {aka '__vector\([48]\) unsigned int'} from type 'struct s'} } */ |
| 108 |
uv2 = s; /* { dg-error {assigning to type 'user_vector_copy' {aka '__vector\([48]\) unsigned int'} from type 'struct s'} } */ |
| 109 |
uv_ptr1 = &s; /* { dg-error {assignment to 'user_vector_ptr' {aka '__vector\([48]\) unsigned int \*'} from incompatible pointer type 'struct s \*'} } */ |
| 110 |
uv_ptr2 = &s; /* { dg-error {assignment to 'user_vector \*' {aka '__vector\([48]\) unsigned int \*'} from incompatible pointer type 'struct s \*'} } */ |
| 111 |
const_uv_ptr1 = &s; /* { dg-error {assignment to 'const user_vector \*' {aka 'const __vector\([48]\) unsigned int \*'} from incompatible pointer type 'struct s \*'} } */ |
| 112 |
const_uv_ptr2 = &s; /* { dg-error {assignment to 'const user_vector_copy \*' {aka 'const __vector\([48]\) unsigned int \*'} from incompatible pointer type 'struct s \*'} } */ |
| 113 |
|
| 114 |
ui1 = s; /* { dg-error {assigning to type 'user_int' {aka 'int'} from type 'struct s'} } */ |
| 115 |
ui2 = s; /* { dg-error {assigning to type 'user_int_copy' {aka 'int'} from type 'struct s'} } */ |
| 116 |
ui_ptr1 = &s; /* { dg-error {assignment to 'user_int_ptr' {aka 'int \*'} from incompatible pointer type 'struct s \*'} } */ |
| 117 |
ui_ptr2 = &s; /* { dg-error {assignment to 'user_int \*' {aka 'int \*'} from incompatible pointer type 'struct s \*'} } */ |
| 118 |
const_ui_ptr1 = &s; /* { dg-error {assignment to 'const user_int \*' {aka 'const int \*'} from incompatible pointer type 'struct s \*'} } */ |
| 119 |
const_ui_ptr2 = &s; /* { dg-error {assignment to 'const user_int_copy \*' {aka 'const int \*'} from incompatible pointer type 'struct s \*'} } */ |
| 120 |
volatile_ui_ptr1 = &s; /* { dg-error {assignment to 'volatile user_int \*' {aka 'volatile int \*'} from incompatible pointer type 'struct s \*'} } */ |
| 121 |
volatile_ui_ptr2 = &s; /* { dg-error {assignment to 'volatile user_int_copy \*' {aka 'volatile int \*'} from incompatible pointer type 'struct s \*'} } */ |
| 122 |
atomic_ui_ptr1 = &s; /* { dg-error {assignment to '_Atomic user_int \*' {aka '_Atomic int \*'} from incompatible pointer type 'struct s \*'} } */ |
| 123 |
atomic_ui_ptr2 = &s; /* { dg-error {assignment to '_Atomic user_int_copy \*' {aka '_Atomic int \*'} from incompatible pointer type 'struct s \*'} } */ |
| 124 |
ui_array_ptr1 = &s; /* { dg-error {assignment to 'user_int \(\*\)\[10\]' {aka 'int \(\*\)\[10\]'} from incompatible pointer type 'struct s \*'} } */ |
| 125 |
ui_array_ptr2 = &s; /* { dg-error {assignment to 'user_int_copy \(\*\)\[10\]' {aka 'int \(\*\)\[10\]'} from incompatible pointer type 'struct s \*'} } */ |
| 126 |
ui_fn_ptr1 = &s; /* { dg-error {assignment to 'user_int \(\*\)\(void\)' {aka 'int \(\*\)\(void\)'} from incompatible pointer type 'struct s \*'} } */ |
| 127 |
ui_fn_ptr2 = &s; /* { dg-error {assignment to 'void \(\*\)\(user_int\)' {aka 'void \(\*\)\(int\)'} from incompatible pointer type 'struct s \*'} } */ |
| 128 |
ui_fn_ptr3 = &s; /* { dg-error {assignment to 'void \(\*\)\(user_int, \.\.\.\)' {aka 'void \(\*\)\(int, \.\.\.\)'} from incompatible pointer type 'struct s \*'} } */ |
| 129 |
ui_fn_ptr4 = &s; /* { dg-error {assignment to 'user_int_copy \(\*\)\(void\)' {aka 'int \(\*\)\(void\)'} from incompatible pointer type 'struct s \*'} } */ |
| 130 |
ui_fn_ptr5 = &s; /* { dg-error {assignment to 'void \(\*\)\(user_int_copy\)' {aka 'void \(\*\)\(int\)'} from incompatible pointer type 'struct s \*'} } */ |
| 131 |
ui_fn_ptr6 = &s; /* { dg-error {assignment to 'void \(\*\)\(user_int_copy, \.\.\.\)' {aka 'void \(\*\)\(int, \.\.\.\)'} from incompatible pointer type 'struct s \*'} } */ |
| 132 |
unsafe_ui_fn_ptr1 = &s; /* { dg-error {assignment to 'user_int \(__attribute__\(\(transaction_unsafe\)\) \*\)\(void\)' {aka 'int \(__attribute__\(\(transaction_unsafe\)\) \*\)\(void\)'} from incompatible pointer type 'struct s \*'} } */ |
| 133 |
unsafe_ui_fn_ptr2 = &s; /* { dg-error {assignment to 'user_int_copy \(__attribute__\(\(transaction_unsafe\)\) \*\)\(void\)' {aka 'int \(__attribute__\(\(transaction_unsafe\)\) \*\)\(void\)'} from incompatible pointer type 'struct s \*'} } */ |
| 134 |
} |