summaryrefslogtreecommitdiff
path: root/test/regression/bool.c
diff options
context:
space:
mode:
authorGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2012-02-04 19:14:14 +0000
committerGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2012-02-04 19:14:14 +0000
commit25b9b003178002360d666919f2e49e7f5f4a36e2 (patch)
treed5f7fb317f34f3a7ac9383c21b0eb143317c30f8 /test/regression/bool.c
parent145b32ec504541e98f73b2c87ff2d8181b5e7968 (diff)
Merge of the "volatile" branch:
- native treatment of volatile accesses in CompCert C's semantics - translation of volatile accesses to built-ins in SimplExpr - native treatment of struct assignment and passing struct parameter by value - only passing struct result by value remains emulated - in cparser, remove emulations that are no longer used - added C99's type _Bool and used it to express || and && more efficiently. git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@1814 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'test/regression/bool.c')
-rw-r--r--test/regression/bool.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/regression/bool.c b/test/regression/bool.c
new file mode 100644
index 0000000..d2b3857
--- /dev/null
+++ b/test/regression/bool.c
@@ -0,0 +1,29 @@
+/* Testing _Bool type support */
+
+#include <stdio.h>
+
+int x = 42;
+
+int main()
+{
+ _Bool a, b, c, d, e, f, g, h, i;
+ a = x;
+ b = x >= 100;
+ c = &x;
+ d = a && b;
+ e = a || b;
+ f = a & b;
+ g = a | b;
+ h = 3.14;
+ i = 0.0;
+ printf("a = %d\n", a);
+ printf("b = %d\n", b);
+ printf("c = %d\n", c);
+ printf("d = %d\n", d);
+ printf("e = %d\n", e);
+ printf("f = %d\n", f);
+ printf("g = %d\n", g);
+ printf("h = %d\n", h);
+ printf("i = %d\n", i);
+ return 0;
+}