1 /* Test support of scalar_storage_order attribute */
3 /* { dg-do compile } */
5 struct __attribute__((scalar_storage_order("big-endian"))) S1
10 struct __attribute__((scalar_storage_order("little-endian"))) S2
15 extern int foo (void *);
17 int incompatible_call (int which
, struct S1
*s1
, struct S2
*s2
)
19 if (which
== 1) return foo (s1
); else foo (s2
); /* { dg-warning "incompatible scalar storage order" } */
22 void incompatible_assign (struct S1
*s1
, struct S2
*s2
)
25 p1
= s1
, p2
= s2
; /* { dg-warning "incompatible scalar storage order" } */
28 void incompatible_init (struct S1
*s1
, struct S2
*s2
)
30 void *p1
= s1
, *p2
= s2
; /* { dg-warning "incompatible scalar storage order" } */
33 void *incompatible_return (int which
, struct S1
*s1
, struct S2
*s2
)
35 if (which
== 1) return s1
; else return s2
; /* { dg-warning "incompatible scalar storage order" } */