summaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common/cxxbitfields-4.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/c-c++-common/cxxbitfields-4.c')
-rw-r--r--gcc/testsuite/c-c++-common/cxxbitfields-4.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/testsuite/c-c++-common/cxxbitfields-4.c b/gcc/testsuite/c-c++-common/cxxbitfields-4.c
new file mode 100644
index 00000000000..a2d55f4a8c4
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/cxxbitfields-4.c
@@ -0,0 +1,18 @@
+/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
+/* { dg-options "-O2 --param allow-store-data-races=0" } */
+
+struct bits
+{
+ char a;
+ int b:7;
+ int c:9;
+ unsigned char d;
+} x;
+
+/* Store into <c> should not clobber <d>. */
+void update_c(struct bits *p, int val)
+{
+ p -> c = val;
+}
+
+/* { dg-final { scan-assembler-not "movl" } } */