aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/sso-5.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/sso-5.c')
-rw-r--r--gcc/testsuite/gcc.dg/sso-5.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/sso-5.c b/gcc/testsuite/gcc.dg/sso-5.c
new file mode 100644
index 00000000000..8bbb38bf54b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/sso-5.c
@@ -0,0 +1,24 @@
+/* Test support of scalar_storage_order attribute */
+
+/* { dg-do compile } */
+
+struct S3
+{
+ struct __attribute__((scalar_storage_order("big-endian"))) S1
+ {
+ int i;
+ } s1;
+};
+
+struct S4
+{
+ struct __attribute__((scalar_storage_order("little-endian"))) S2
+ {
+ int i;
+ } s2;
+};
+
+void incompatible_assign (struct S3 *s3, struct S4 *s4)
+{
+ s3->s1 = s4->s2; /* { dg-error "(incompatible types|no match)" } */
+}