aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorCyril SIX <cyril.six@kalray.eu>2021-06-01 14:37:07 +0200
committerCyril SIX <cyril.six@kalray.eu>2021-06-01 14:37:07 +0200
commit5a632954c85e8b2b5afea124e4fc83f39c5d3598 (patch)
treed53323083adec47d3338a04b516265c634806bea /test
parenta298e55fdc51cce92a8b39280643b623d7d991a8 (diff)
downloadcompcert-kvx-5a632954c85e8b2b5afea124e4fc83f39c5d3598.tar.gz
compcert-kvx-5a632954c85e8b2b5afea124e4fc83f39c5d3598.zip
[BROKEN] Merge with v3.9 : something broken for __builtin_expect in cfrontend/C2C.ml
Diffstat (limited to 'test')
-rw-r--r--test/regression/Makefile2
-rw-r--r--test/regression/Results/bitfields_uint_t1
-rw-r--r--test/regression/bitfields_uint_t.c22
3 files changed, 24 insertions, 1 deletions
diff --git a/test/regression/Makefile b/test/regression/Makefile
index f74e1441..9661a99e 100644
--- a/test/regression/Makefile
+++ b/test/regression/Makefile
@@ -23,7 +23,7 @@ TESTS?=int32 int64 floats floats-basics floats-lit \
# Can run, but only in compiled mode, and have reference output in Results
TESTS_COMP?=attribs1 bitfields1 bitfields2 bitfields3 bitfields4 \
- bitfields5 bitfields6 bitfields7 bitfields8 \
+ bitfields5 bitfields6 bitfields7 bitfields8 bitfields_uint_t \
builtins-common builtins-$(ARCH) packedstruct1 packedstruct2 alignas \
varargs1 varargs2 varargs3 sections alias aligned
diff --git a/test/regression/Results/bitfields_uint_t b/test/regression/Results/bitfields_uint_t
new file mode 100644
index 00000000..f55071d0
--- /dev/null
+++ b/test/regression/Results/bitfields_uint_t
@@ -0,0 +1 @@
+x = { a = 1, b = 2, c = 3, d = 4 }
diff --git a/test/regression/bitfields_uint_t.c b/test/regression/bitfields_uint_t.c
new file mode 100644
index 00000000..3d7fb4e7
--- /dev/null
+++ b/test/regression/bitfields_uint_t.c
@@ -0,0 +1,22 @@
+#include <stdio.h>
+#include <stdint.h>
+
+/* Test that uint32 type synonym works.
+ This previously failed for standard headers where uint32 is defined
+ as a (32-bit) unsigned long. */
+
+struct s {
+ uint32_t a: 1;
+ uint32_t b: 2;
+ uint32_t c: 9;
+ uint32_t d: 20;
+};
+
+struct s x = { 1, 2, 3, 4 };
+
+int main()
+{
+ printf("x = { a = %d, b = %d, c = %d, d = %d }\n", x.a, x.b, x.c, x.d);
+}
+
+