aboutsummaryrefslogtreecommitdiff
path: root/tcctest.c
diff options
context:
space:
mode:
authorbellard <bellard>2002-09-08 21:56:11 +0000
committerbellard <bellard>2002-09-08 21:56:11 +0000
commit1cb355747a93bd81397f4763fd2f7eb8a193ebea (patch)
treeb57d98df089f3ac5291c6233c105ce9f7b39e179 /tcctest.c
parent8ecc9cd789e105c1806db0ab7d7cc293611f9a7f (diff)
downloadtinycc-1cb355747a93bd81397f4763fd2f7eb8a193ebea.tar.gz
tinycc-1cb355747a93bd81397f4763fd2f7eb8a193ebea.tar.bz2
update
Diffstat (limited to 'tcctest.c')
-rw-r--r--tcctest.c25
1 files changed, 22 insertions, 3 deletions
diff --git a/tcctest.c b/tcctest.c
index a3c93c0..414df55 100644
--- a/tcctest.c
+++ b/tcctest.c
@@ -240,8 +240,8 @@ void string_test()
printf("wc=%C 0x%lx %C\n", L'a', L'\x1234', L'c');
printf("wstring=%S\n", L"abc");
printf("wstring=%S\n", L"abc" L"def" "ghi");
- printf("'\\377'=%d '\xff'=%d\n", '\377', '\xff');
- printf("L'\\377'=%d L'\xff'=%d\n", L'\377', L'\xff');
+ printf("'\\377'=%d '\\xff'=%d\n", '\377', '\xff');
+ printf("L'\\377'=%d L'\\xff'=%d\n", L'\377', L'\xff');
ps("test\n");
b = 32;
while ((b = b + 1) < 96) {
@@ -703,7 +703,7 @@ typedef struct Sym {
void bool_test()
{
- int *s, a, b;
+ int *s, a, b, t, f;
a = 0;
s = (void*)0;
@@ -738,6 +738,25 @@ void bool_test()
a = (a + b) * ((a < b) ?
((b - a) * (a - b)): a + b);
printf("a=%d\n", a);
+
+ /* test complex || or && expressions */
+ t = 1;
+ f = 0;
+ a = 32;
+ printf("exp=%d\n", f == (32 <= a && a <= 3));
+ printf("r=%d\n", (t || f) + (t && f));
+
+ /* test ? : cast */
+ {
+ int aspect_on;
+ int aspect_native = 65536;
+ double bfu_aspect = 1.0;
+ int aspect;
+ for(aspect_on = 0; aspect_on < 2; aspect_on++) {
+ aspect=aspect_on?(aspect_native*bfu_aspect+0.5):65535UL;
+ printf("aspect=%d\n", aspect);
+ }
+ }
}