aboutsummaryrefslogtreecommitdiffstats
path: root/test/clightgen
diff options
context:
space:
mode:
authorYann Herklotz <git@yannherklotz.com>2021-09-17 16:52:29 +0100
committerYann Herklotz <git@yannherklotz.com>2021-09-17 16:52:29 +0100
commit4be142376801c205ffd701208fad8eedf2c08d90 (patch)
treed2f4d54cc34319e380e349eddef61c2994202e8b /test/clightgen
parent48a9dcbdc968bcf05b4eec17b8c7fd471fb80240 (diff)
parentc9fad7cd7bdc4e79fb06a1d39abfa0d5471623e5 (diff)
downloadcompcert-4be142376801c205ffd701208fad8eedf2c08d90.tar.gz
compcert-4be142376801c205ffd701208fad8eedf2c08d90.zip
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'test/clightgen')
-rw-r--r--test/clightgen/annotations.c2
-rw-r--r--test/clightgen/bitfields.c13
2 files changed, 14 insertions, 1 deletions
diff --git a/test/clightgen/annotations.c b/test/clightgen/annotations.c
index e91c7fbc..993fa7d0 100644
--- a/test/clightgen/annotations.c
+++ b/test/clightgen/annotations.c
@@ -1,6 +1,6 @@
int f(int x, long y)
{
-#if !defined(SYSTEM_macosx) && !defined(SYSTEM_cygwin)
+#if !defined(SYSTEM_macos) && !defined(SYSTEM_cygwin)
__builtin_ais_annot("x is %e1, y is %e2", x, y);
#endif
__builtin_annot("x is %1, y is %2", x, y);
diff --git a/test/clightgen/bitfields.c b/test/clightgen/bitfields.c
new file mode 100644
index 00000000..34f6a686
--- /dev/null
+++ b/test/clightgen/bitfields.c
@@ -0,0 +1,13 @@
+struct s {
+ int a: 10;
+ char : 6;
+ _Bool b : 1;
+ int : 0;
+ short c: 7;
+};
+
+int f(void)
+{
+ struct s x = { -1, 1, 2 };
+ return x.a + x.b + x.c;
+}