aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/sso-1.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/sso-1.c')
-rw-r--r--gcc/testsuite/gcc.dg/sso-1.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/sso-1.c b/gcc/testsuite/gcc.dg/sso-1.c
new file mode 100644
index 00000000000..b2e11bd00d3
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/sso-1.c
@@ -0,0 +1,19 @@
+/* Test support of scalar_storage_order attribute */
+
+/* { dg-do compile } */
+
+int i;
+
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+struct __attribute__((scalar_storage_order("big-endian"))) Rec
+{
+ int *p;
+};
+#else
+struct __attribute__((scalar_storage_order("little-endian"))) Rec
+{
+ int *p;
+};
+#endif
+
+struct Rec r = { &i }; /* { dg-error "element is not constant" } */