History

update

bellard committed 24 years ago

Commit 1cb35571 parent 8ecc9cd1 file · +22 −3Browse files

Unified · Split

tcctest.c+22−3
@@ -240,8 +240,8 @@ void string_test() · 239 unmodified lines
240240 printf("wc=%C 0x%lx %C\n", L'a', L'\x1234', L'c');
241241 printf("wstring=%S\n", L"abc");
242242 printf("wstring=%S\n", L"abc" L"def" "ghi");
243− printf("'\\377'=%d '\xff'=%d\n", '\377', '\xff');
244− printf("L'\\377'=%d L'\xff'=%d\n", L'\377', L'\xff');
243+ printf("'\\377'=%d '\\xff'=%d\n", '\377', '\xff');
244+ printf("L'\\377'=%d L'\\xff'=%d\n", L'\377', L'\xff');
245245 ps("test\n");
246246 b = 32;
247247 while ((b = b + 1) < 96) {
@@ -703,7 +703,7 @@ typedef struct Sym { · 455 unmodified lines
703703
704704 void bool_test()
705705 {
706− int *s, a, b;
706+ int *s, a, b, t, f;
707707
708708 a = 0;
709709 s = (void*)0;
@@ -738,6 +738,25 @@ void bool_test() · 28 unmodified lines
738738 a = (a + b) * ((a < b) ?
739739 ((b - a) * (a - b)): a + b);
740740 printf("a=%d\n", a);
741+
742+ /* test complex || or && expressions */
743+ t = 1;
744+ f = 0;
745+ a = 32;
746+ printf("exp=%d\n", f == (32 <= a && a <= 3));
747+ printf("r=%d\n", (t || f) + (t && f));
748+
749+ /* test ? : cast */
750+ {
751+ int aspect_on;
752+ int aspect_native = 65536;
753+ double bfu_aspect = 1.0;
754+ int aspect;
755+ for(aspect_on = 0; aspect_on < 2; aspect_on++) {
756+ aspect=aspect_on?(aspect_native*bfu_aspect+0.5):65535UL;
757+ printf("aspect=%d\n", aspect);
758+ }
759+ }
741760 }
742761
743762

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t