summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2010-04-09 12:26:47 +0000
committerGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2010-04-09 12:26:47 +0000
commitbae0ed25d01388093ebcb4b32db0b6d1169f17db (patch)
tree31d5a3dbddda88ceb3252fa1ec39030e815c6900 /test
parentd966e01ea011fa66d5a5a7f9ffce4344e415981a (diff)
Test bit field of size 32
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@1313 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'test')
-rw-r--r--test/regression/Makefile2
-rw-r--r--test/regression/Results/bitfields32
-rw-r--r--test/regression/bitfields3.c15
3 files changed, 18 insertions, 1 deletions
diff --git a/test/regression/Makefile b/test/regression/Makefile
index 9fcd82f..08e1f70 100644
--- a/test/regression/Makefile
+++ b/test/regression/Makefile
@@ -7,7 +7,7 @@ CCOMPFLAGS=-stdlib ../../runtime -dparse -dclight -dasm \
LIBS=$(LIBMATH)
# Can run and have reference output in Results
-TESTS=bitfields1 bitfields2 expr1 initializers volatile2 funct3 expr5
+TESTS=bitfields1 bitfields2 bitfields3 expr1 initializers volatile2 funct3 expr5
# Other tests: should compile to .s without errors (but expect warnings)
EXTRAS=commaprec expr2 expr3 expr4 extern1 funct2 funptr1 init1 \
diff --git a/test/regression/Results/bitfields3 b/test/regression/Results/bitfields3
new file mode 100644
index 0000000..4f90515
--- /dev/null
+++ b/test/regression/Results/bitfields3
@@ -0,0 +1,2 @@
+x = {a = 12345678}
+x = {a = deadbeef}
diff --git a/test/regression/bitfields3.c b/test/regression/bitfields3.c
new file mode 100644
index 0000000..de29f4d
--- /dev/null
+++ b/test/regression/bitfields3.c
@@ -0,0 +1,15 @@
+#include <stdio.h>
+
+struct s {
+ unsigned int a: 32;
+};
+
+struct s x = { 0x12345678 };
+
+int main()
+{
+ printf("x = {a = %x}\n", x.a);
+ x.a = 0xDEADBEEF;
+ printf("x = {a = %x}\n", x.a);
+ return 0;
+}