summaryrefslogtreecommitdiff
path: root/gcc_arm/testsuite/consistency.vlad/layout/f-14-29-30.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc_arm/testsuite/consistency.vlad/layout/f-14-29-30.c')
-rwxr-xr-xgcc_arm/testsuite/consistency.vlad/layout/f-14-29-30.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/gcc_arm/testsuite/consistency.vlad/layout/f-14-29-30.c b/gcc_arm/testsuite/consistency.vlad/layout/f-14-29-30.c
new file mode 100755
index 0000000..3d95e82
--- /dev/null
+++ b/gcc_arm/testsuite/consistency.vlad/layout/f-14-29-30.c
@@ -0,0 +1,31 @@
+#include <stdio.h>
+
+struct sss{
+ int i1:14;
+ int i2:29;
+ int i3:30;
+};
+
+static union u{
+ struct sss sss;
+ unsigned char a[sizeof (struct sss)];
+} u;
+
+int main (void) {
+ int i;
+ for (i = 0; i < sizeof (struct sss); i++)
+ u.a[i] = 0;
+ u.sss.i1 = 16383.0;
+ for (i = 0; i < sizeof (struct sss); i++)
+ printf ("%x ", u.a[i]);
+ printf ("\n");
+ u.sss.i2 = 536870911.0;
+ for (i = 0; i < sizeof (struct sss); i++)
+ printf ("%x ", u.a[i]);
+ printf ("\n");
+ u.sss.i3 = 1073741823.0;
+ for (i = 0; i < sizeof (struct sss); i++)
+ printf ("%x ", u.a[i]);
+ printf ("\n");
+ return 0;
+}